# CodeForces - 140A New Year Table （几何题）当时没想出来-----补题

A. New Year Table time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output 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.

Input 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.

Output 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.

Examples inputCopy 4 10 4 outputCopy YES inputCopy 5 10 4 outputCopy NO inputCopy 1 10 10 outputCopy YES Note The possible arrangement of the plates for the first sample is:

```#include <cstdio>
#include <iostream>
#include <cmath>
using namespace std;
const double PI=acos(-1.0);
int main()
{
int n,R,r;
cin>>n>>R>>r;
if(r>R)
{
cout<<"NO"<<endl;
return 0;
}
else if(r>(R-r))
{
if(n==1)cout<<"YES"<<endl;
else  cout<<"NO"<<endl;
return 0;
}
double agle=asin((double)r/(double)(R-r));  //计算角度
if(2.0*PI-2.0*agle*n>=-1e-12)  //精度是真高
cout<<"YES"<<endl;
else
cout<<"NO"<<endl;
return 0;
}```

0 条评论

• ### Codeforces 1291 Round #616 (Div. 2) C. Mind Control（超级详细）

You and your n−1 friends have found an array of integers a1,a2,…,an. You have de...

• ### ZOJ 3623 Battle Ships

Battle Ships Time Limit: 2 Seconds Memory Limit: 65536 KB Battle Ships is a ne...

• ### Codeforces Round #622 (Div. 2) 1313 C1

C1. Skyscrapers (easy version) time limit per test1 second memory limit per te...

• ### 什么是SAP物料主数据里的Batch

Materials are produced and theoretically have the same properties. Nevertheless ...

• ### POJ-1953 World Cup Noise（线性动规）

World Cup Noise Time Limit: 1000MS Memory Limit: 30000K Total Submissio...

• ### How to find “hidden” remote jobs using Google Search.

By using a special search operator with Google search, you can find remote jobs ...

• ### ABAP如何在调试查看EXPORT/IMPORT 内存数据

These memory IDs can be accessed in the debugger, but the option isn't accessibl...

• ### Codeforces 1291 Round #616 (Div. 2) C. Mind Control（超级详细）

You and your n−1 friends have found an array of integers a1,a2,…,an. You have de...

• ### 使用SAP Transaction Launcher将ABAP Webdynpro嵌入到WebClient UI中

THINK twice why you want to include an ABAP webdynpro component into CRM UI, as ...

• ### 使用SAP Transaction Launcher将ABAP Webdynpro嵌入到WebClient UI中

THINK twice why you want to include an ABAP webdynpro component into CRM UI, as ...