HDU 4523 (Large integer)

Source: Internet
Author: User

Willie Cat series Story-Birthday

Time limit:500/200 MS (java/others) Memory limit:65535/32768 K (java/others)
Total submission (s): 1330 Accepted Submission (s): 365


Problem Description February 29 is Willie Cat's birthday, because this day is very special, 4 years only once, so many friends of birthday this day to the Willie Cat home to congratulate his birthday.
Everyone to Willie Cat bought a very big very big cake, the shape of the cake is a n-side convex polygon, but Willie Cat's aesthetic sense has a little strange, he only like the cake with M-side, so he asked the partners to cut the cake p times, and then give him a only m-side of the new cake. This is urgent, this is not the pit father, the aesthetic rugged mischief.
Suppose the cake can be regarded as a plane with n-side convex polygon, each knife must be cut along a straight line, p-knife can give Willie Cat cut out a M-edge cake?

Input multiple sets of test data, one row per group, containing 3 integers n, m, p (meaning above).
[Technical specification]
3 <= N <= 10^100
0 < M <= 10^100
0 <= P <= 10^100

Output each set of test data, if you can cut out Willie cat like cake, please export "YES", otherwise, output "NO";
One row for each set of data output.

Sample INPUT4 5 1

Sample Outputyes cut a knife can be more than one edge, so cut p knife up to become n+p edge shape, but at least also a triangle, so m in 3~n+p between OK, and then this problem has 10^100, so with large integers do.
ImportJava.math.BigInteger;ImportJava.util.Scanner; Public classMain { Public Static voidMain (string[] args) {Scanner sc=NewScanner (system.in);  while(Sc.hasnext ()) {String S1=Sc.next (); String S2=Sc.next (); String S3=Sc.next (); BigInteger N=NewBigInteger (S1); BigInteger m=NewBigInteger (S2); BigInteger P=NewBigInteger (S3); BigInteger three= Biginteger.valueof (3); if(N.add (P). CompareTo (M) >=0&&m.compareto (three) >=0) {System.out.println ("YES"); }Else{System.out.println ("NO"); }         }     }}

HDU 4523 (Large integer)

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.