HDU 1065 (push formula)

Source: Internet
Author: User

I Think I need a houseboat

Time limit:2000/1000 MS (java/others) Memory limit:65536/32768 K (java/others)
Total submission (s): 12114 Accepted Submission (s): 3407


Problem Description

Fred Mapper is considering purchasing some land in Louisiana to build he house on. In the process of investigating the land, he learned, and the state of Louisiana are actually shrinking by the square miles Due to erosion caused by the Mississippi River. Since Fred was hoping to live in this House the rest of his life, he needs to know if he land was going to being lost to Erosi On.

After doing more, Fred had learned the land, which is being lost forms a semicircle. This semicircle was part of a circle centered at (0,0) and with the line that bisects the circle being the X axis. Locations below the X axis is in the water. The semicircle has a area of 0 at the beginning of 1. (Semicircle illustrated in the figure.)

Inputthe first line of input would be a positive integer indicating how many data sets would be included (N).

Each of the next N lines would contain the X and Y Cartesian coordinates of the land Fred are considering. These'll is floating point numbers measured in miles. The Y coordinate would be non-negative. (0,0) won't is given.

Output

For the data set, a single line of output should appear. This line should take the form of:

"N:this property would begin eroding in year Z."

Where N is the data set (counting from 1), and Z are the first year (start from 1) This property would be within the SEMICIR CLE at the END of year Z. Z must is an integer.

After the last data set, this should print out "END of OUTPUT."

Notes:

1. No property would appear exactly on the semicircle boundary:it would either be inside or outside.

2. This problem'll be judged automatically. Your answer must match exactly, including the capitalization, punctuation, and white-space. This includes the periods at the ends of the lines.

3. All locations is given in miles.

Pi*r[n]^2-pi*r[n-1]^2 =100 Get r[n]^2 = 100*n/pi

Direct results, essay toxic, PI can only take 3.1415926

#include <cstdio>#include<cstring>#include<algorithm>#include<math.h>using namespaceStd;typedefLong LongLL;Const DoublePI =3.1415926;intMain () {intT; scanf ("%d",&t);  for(intI=1; i<=t; i++)    {        Doublex, y; scanf ("%LF%LF",&x,&y); DoubleR = x*x+y*y;///the square of the radiusprintf"Property%d:this property would begin eroding in year%d.\n", I, (int) (R) *pi/ -+1)); } printf ("END of output.\n"); return 0;}

HDU 1065 (push formula)

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.