A. New Year table

Source: Internet
Author: User
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;}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.