Time limit per test
2 seconds
Memory limit per test
256 megabytes
Input
Standard Input
Output
Standard output
Gerald is setting the new year table. The table has the form of a circle; its radius equalsR. Gerald invited into 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 equalR.
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 enoughNPlates.
Input
The first line contains three IntegersN,RAndR(1 digit ≤ DigitNLimit ≤ limit 100, 1 limit ≤ limitR, Bytes,RLimit ≤00001000)
-The number of plates, the radius of the table and the plates 'radius.
Output
Print "yes" (without the quotes) if it is possible to placeNPlates
On the table by the rules given abve. If it is impossible, print "no ".
Remember, that each plate must touch the edge of the table.
Sample test (s) Input
4 10 4
Output
YES
Input
5 10 4
Output
NO
Input
1 10 10
Output
YES
Note
The possible arrangement of the plates for the first sample is:
Problem description: This is to judge that N disks with a radius of R are placed on a table with a radius of R, which requires no overlap. In fact, this is a geometric problem. You can draw a picture to help understand it.
#include<stdio.h>#include<conio.h>#include<math.h>#include<stdlib.h>int main(){int n,R,r;double a;scanf("%d %d %d",&n,&R,&r);if (r>R){printf("NO\n");}else if (r+r>R) {if (n==1) {printf("YES\n");}else{printf("NO\n");}} else {a=asin((double)r/(R-r));if (acos(-1)-a*n>-1e-12){printf("YES\n");}else{printf("NO\n");}}return 0;}