CF140A.New Year Table

普及+/提高

通过率:0%

时间限制:2.00s

内存限制:256MB

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Gerald is setting the New Year table. The table has the form of a circle; its radius equals R. Gerald invited many guests and is concerned whether the table has enough space for plates for all those guests. Consider all plates to be round and have the same radii that equal r. Each plate must be completely inside the table and must touch the edge of the table. Of course, the plates must not intersect, but they can touch each other. Help Gerald determine whether the table is large enough for n plates.

杰拉尔德正在布置新年餐桌。餐桌呈圆形,半径为 RR。杰拉尔德邀请了许多客人,他担心餐桌是否能为所有客人摆放足够的餐盘。假设所有餐盘均为圆形,且半径均为 rr。每个餐盘必须完全置于餐桌内部,并且必须与餐桌边缘相切。当然,餐盘之间不能相交,但可以互相相切。请帮助杰拉尔德判断:该餐桌是否足以摆放 nn 个餐盘?

输入格式

The first line contains three integers n, R and r (1 ≤ n ≤ 100, 1 ≤ r, R ≤ 1000) — the number of plates, the radius of the table and the plates' radius.

第一行包含三个整数 nn、RR 和 rr(1 ≤ n ≤ 1001 ≤ n ≤ 100,1 ≤ r, R ≤ 10001 ≤ r, R ≤ 1000)—— 分别表示盘子的数量、桌子的半径以及盘子的半径。

输出格式

Print "YES" (without the quotes) if it is possible to place n plates on the table by the rules given above. If it is impossible, print "NO".

Remember, that each plate must touch the edge of the table.

如果能按照上述规则将 n 个盘子放置在桌子上,则输出 "YES"(不带引号);否则输出 "NO"。

注意:每个盘子都必须与桌子边缘接触。

输入输出样例

  • 输入#1

    4 10 4

    输出#1

    YES
  • 输入#2

    5 10 4

    输出#2

    NO
  • 输入#3

    1 10 10

    输出#3

    YES

说明/提示

The possible arrangement of the plates for the first sample is:

第一个样例中盘子的可能排列方式为:

输入解题思路,AI测评打分。不知道怎么写?

首页