杭电OJ题 1065 I Think I Need a Houseboat解题报告

来源:互联网 发布:php从入门到精通 源码 编辑:程序博客网 时间:2024/05/14 03:40

I Think I Need a Houseboat

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 5835    Accepted Submission(s): 1737


Problem Description


Fred Mapper is considering purchasing some land in Louisiana to build his house on. In the process of investigating the land, he learned that the state of Louisiana is actually shrinking by 50 square miles each year, due to erosion caused by the Mississippi River. Since Fred is hoping to live in this house the rest of his life, he needs to know if his land is going to be lost to erosion. 

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


 

Input
The first line of input will be a positive integer indicating how many data sets will be included (N). 

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

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

“Property N: This property will begin eroding in year Z.” 

Where N is the data set (counting from 1), and Z is the first year (start from 1) this property will be within the semicircle AT THE END OF YEAR Z. Z must be an integer. 

After the last data set, this should print out “END OF OUTPUT.” 

Notes: 

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

2. This problem will 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 are given in miles.
 

Sample Input
2 1.0 1.0 25.0 0.0
 

Sample Output
Property 1: This property will begin eroding in year 1. Property 2: This property will begin eroding in year 20. END OF OUTPUT.
 

————————————————————————————————————
/**************************** *Name:I Think I Need a Houseboat.c *Tags:ACM Math ****************************/#include <stdio.h>#include <math.h>int main(){double x,y;double area;int n,i,year;scanf("%d", &n);if(n == 0)return 0;for(i = 0; i < n; i++) {scanf("%lf%lf", &x, &y);area = (3.1415926 * (x*x+y*y));year = (int )(area / (2*50));printf("Property %d: This property will begin eroding in year %d.\n", i+1, year+1);}printf("END OF OUTPUT.\n");return 0;}


原创粉丝点击
热门问题 老师的惩罚 人脸识别 我在镇武司摸鱼那些年 重生之率土为王 我在大康的咸鱼生活 盘龙之生命进化 天生仙种 凡人之先天五行 春回大明朝 姑娘不必设防,我是瞎子 qq账号被永久冻结怎么办 多多理财账号冻结了怎么办 苹果id安全问题忘记了怎么办 网易邮箱帐号忘了怎么办 网易邮箱密码忘记了怎么办 网易邮箱密码忘了怎么办 网易邮箱忘记邮箱账号怎么办 崩坏3三无号被盗怎么办 qq邮箱给58占用怎么办 支付宝邮箱被占用怎么办 苹果手机下载不了qq怎么办 附件预览时发生错误怎么办 手机下载的压缩包打不开怎么办 邮箱提示中转站剩余容量不足怎么办 手机邮箱密码忘记了怎么办 垃圾邮件被系统删除了怎么办 邮箱里的邮件下载不了怎么办 qq邮箱下载不了文件怎么办 苹果手机忘记邮箱密码怎么办 oppo手机安装包损坏怎么办 手机安装包损坏无法安装怎么办 手机qq安装包损坏了怎么办 安装包损坏无法安装怎么办 方舟生存进化安装包损坏怎么办 如果安装包坏了怎么办 酷狗下载音乐收费怎么办 酷狗下载歌曲收费怎么办 酷狗音乐下载歌曲要钱怎么办 酷狗音乐下载要钱怎么办 手机酷狗音乐下载收费怎么办 咪咕视频静音了怎么办 卡西欧自拍神器死机了怎么办 手机一自拍就死机怎么办 微信怎么黑屏了怎么办 宝宝睡袋买大了怎么办 社保中间断了一年怎么办 京东阅读换手机怎么办 酷狗自动续费怎么办 qq音乐下载需要钱怎么办 电脑播放音乐没声音怎么办 酷狗账号注销了怎么办