I Think I Need a Houseboat

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.

————————————————————————————————————————

水题,算出所给点为半径的半圆面积去除以50 就可以了,要注意pi取3.1415926  刚开始多取了几位wa了,不甘心



#include<iostream>
#include<cmath>
using namespace std;
#define pi 3.1415926
int main()
{
double x,y,s;
int a,cnt,o;
while(~scanf("%d",&o))
{
cnt=0;
for(int cnt=1;cnt<=o;cnt++)
{
scanf("%lf%lf",&x,&y);
s = pi * (x*x+y*y)/2; a = (int)(s/50) + 1; printf("Property %d: This property will begin eroding in year %d.\n",cnt,a); }
printf("END OF OUTPUT.\n"); }
return 0; }

HDU1065 I Think I Need a Houseboat 2016-07-24 13:59 101人阅读 评论(0) 收藏的更多相关文章

  1. I Think I Need a Houseboat 分类: POJ 2015-06-11 17:52 12人阅读 评论(0) 收藏

    I Think I Need a Houseboat Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 92090   Acce ...

  2. http://www.cnbc.com/2016/07/12/tensions-in-south-china-sea-to-persist-even-after-court-ruling.html

    http://www.cnbc.com/2016/07/12/tensions-in-south-china-sea-to-persist-even-after-court-ruling.html T ...

  3. 2016.3.24 OneZero站立会议

    会议时间:2016.3.24 15:35-15:55 会议成员:王巍 夏一名 冉华 张敏 会议内容: 1.确立UI界面原形(见http://www.cnblogs.com/zhangminss/p/5 ...

  4. Murano Weekly Meeting 2016.05.24

    Meeting time: 2016.May.24 1:00~2:00 Chairperson:  Kirill Zaitsev, from Mirantis Meeting summary: 1.A ...

  5. 2016.9.24初中部上午NOIP普及组比赛总结

    2016.9.24初中部上午NOIP普及组比赛总结 2016.09.24[初中部 NOIP普及组 ]模拟赛 其实这次我没比赛,早上去参加亲子活动去了. 不过在下午我做完了所有的题,感觉还好. 进度 现 ...

  6. HDU1065 I Think I Need a Houseboat 【数学递推】

    I Think I Need a Houseboat Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Ja ...

  7. “耐撕”团队 2016.03.24 站立会议

    时间: 2016.03.22  17:00-17:30     18:30-19:00 成员: Z 郑蕊 * 组长 (博客:http://www.cnblogs.com/zhengrui0452/), ...

  8. 2016 - 1- 21 - RunLoop使用(2016-1-24修改一次)&(2016 - 1 - 24 再次修改)

    一:常驻线程 :当需要一个线程一直处理一些耗时操作时,可以让它拥有一个RunLoop.具体代码如下:    1.通过给RunloopMode里加源来保证RunLoop不直接退出. 这里有个很重要得知识 ...

  9. OneZero第四次站立会议(2016.3.24)

    会议时间:2016年3月24日 15:30~15:47 会议成员:冉华,张敏,王巍,夏一鸣. 会议目的:汇报前一天工作,全体成员评论,确定会后修改内容. 会议内容:以下为会议插图 1.界面原型方面,在 ...

随机推荐

  1. scala-学习 1

    目录 变量定义 scala定义两种变量: var 可变 初始化之后,可以多次被重新赋值 val 不可变 一旦被初始化 就不能再赋值. var firstarg :java.lang.String = ...

  2. zset

    zset sorted set,有序集合 元素为string类型 元素具有唯一性,不重复 每个元素都会关联一个double类型的score,表示权重,通过权重将元素从小到大排序 说明:没有修改操作 增 ...

  3. Js获取iframe子页面全局变量

    项目中通过iframe内嵌了一个子页面,子页面定义了一些全局变量,父页面需要获取子页面的全局变量,做了一些测试(我的环境IE10和Firefox32.0.3),得出如下结论: IE下: window. ...

  4. eclipse UTF-8

    1. 你本地开发环境IDE,默认配置也是gbk,改为utf82. 检查你tomcat等服务器中间件GBK改成UTF8eclipse工作空间的编码设置成UTF-8,具体操作是:windows---pre ...

  5. spring jpa exists

    Subquery<A> subquery = criteriaQuery.subquery(A.class);Root<A> root1 = subquery.from(A.c ...

  6. iOS - OC - 字典快速遍历

    1. [dic enumerateKeysAndObjectsUsingBlock:^(id  _Nonnull key, id  _Nonnull obj, BOOL * _Nonnull stop ...

  7. oracle基本查询入门(一)

    一.基本select语句 SELECT *|{[DISTINCT] column|expression [alias], ...} FROM table; 例如: --查询所有数据 select * ...

  8. 【SQL模板】三.插入/更新 数据模板TSQL

    ---Name: 插入/更新 数据模板.sql ---Purpose: 用于更新 数据库中 历史数据 或 插入 新数据 的脚本模板 ---Author: xx ---Time: 2015-12-18 ...

  9. MVC仓储使用join

    代码: var result = from mpc in this.Context.Set<Domain.S_MENU_PURVIEWCODE>() join menu in this.C ...

  10. linux 动态库 静态库 函数覆盖

    本文讨论了linux动态库  静态库中函数的覆盖问题. 测试目的: 同名函数,分别打成动态库libdync_lib.so与静态库libstatic_lib.a,并把libstatic_lib.a打到另 ...