I Think I Need a Houseboat

Time Limit : 2000/1000ms (Java/Other)   Memory Limit : 65536/32768K (Java/Other)
Total Submission(s) : 160   Accepted Submission(s) : 21
Problem Description
[img]/data/images/1065-1.gif[/img] 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.) [img]/data/images/1065-2.gif[/img]
 
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.
 
Source
Mid-Atlantic USA 2001

 #include <stdio.h>
#include <stdlib.h>
#include <math.h> int main()
{
int N,sign,i,signz=;
double x,y,z,T=3.1415926,SUM;
scanf("%d",&N);
while(N--)
{
scanf("%lf%lf",&x,&y);
z=x*x+y*y;
SUM=(T*z)/;
i=(int)(SUM/)+;
signz++;
printf("Property %d: This property will begin eroding in year %d.\n",signz,i);
if(N==)
printf("END OF OUTPUT.\n");
}
return ;
}

I Think I Need a Houseboat的更多相关文章

  1. poj 1005:I Think I Need a Houseboat(水题,模拟)

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

  2. 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 ...

  3. [POJ] #1005# I Think I Need a Houseboat : 浮点数运算

    一. 题目 I Think I Need a Houseboat Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 97512 ...

  4. OpenJudge/Poj 1005 I Think I Need a Houseboat

    1.链接地址: http://bailian.openjudge.cn/practice/1005/ http://poj.org/problem?id=1005 2.题目: I Think I Ne ...

  5. 每天一道算法_6_I Think I Need a Houseboat

    今天的题目是I Think I Need a Houseboat 如下: Description Fred Mapper is considering purchasing some land in ...

  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. I Think I Need a Houseboat POJ - 1005

    I Think I Need a Houseboat POJ - 1005 解题思路:水题 #include <iostream> #include <cstdio> #inc ...

  8. HDU1065 I Think I Need a Houseboat 2016-07-24 13:59 101人阅读 评论(0) 收藏

    I Think I Need a Houseboat Problem Description Fred Mapper is considering purchasing some land in Lo ...

  9. POJ. 1005 I Think I Need a Houseboat(水 )

    POJ. 1005 I Think I Need a Houseboat(水 ) 代码总览 #include <cstdio> #include <cstring> #incl ...

随机推荐

  1. 《Intel汇编第5版》 Mov指令

    一.Mov用于数据传送,用法如下: 二.当传送的数据和目标数据位宽不一致的时候,需要使用MOVZX.MOVSX扩展.MOVZX使用0填充高位,MOVSX使用源操作数最高位填充 下面是汇编代码演示: I ...

  2. 关于Java配置文件properties的学习

    在Java早期的开发中,常用*.properties文件存储一些配置信息.其文件中的信息主要是以key=value的方式进行存储,在早期受到广泛的应用.而后随着xml使用的广泛,其位置渐渐被取代,不过 ...

  3. JDOM与DOM主要有两方面不同

    我这丝毫没有吐槽的意思哟,只是想说作为一个合格的程序员大家最起码需要做到思维严谨这点,在有能力的情况下对用户体验能提点建议最好.自己写的代码一定要经过严格测试再交付,不要指望测试人员帮你测试再去修改, ...

  4. BFS,DFS伪代码

    //bfs #define queue_init (head=tail=0) #define queue_is_empty (head==tail) #define en_queue(x) (queu ...

  5. Python笔记5(字符串)-20160921

    一.字符串常用方法 1.title():返回字符串的标题版本,即单词首字母大写其余字母小写 2.upper():返回字符串全部大写版本,lower()则返回字符串全部小写版本 >>> ...

  6. tomcat + jenkins启动tomcat后打开jenkins页面提示404错误的解决方案

    首先下载tomcat和jenkins,将下载的jenkins2.12 war放到tomcat的webapps文件夹下后执行/bin文件夹下的start启动后,打开http://localhost:80 ...

  7. crontab记录

    简单说一下分类: 1.系统定时路径在/etc/crontab,直接进行编辑即可,这里注意,设定执行时间之后,第二个要跟用户名 ,例如: 1 * * * * root run-parts /etc/cr ...

  8. C# XML配置文件读写类(用于程序配置保存)

    调用方式 //初始化并指定文件路径 XmlConfigUtil util = new XmlConfigUtil("C:\\1.xml"); //写入要保存的值以及路径(Syste ...

  9. c++字体对齐

    字节对齐的细节和编译器实现相关,但一般而言,满足三个准则:    1) 结构体变量的首地址能够被其最宽基本类型成员的大小所整除.   2) 结构体每个成员相对于结构体首地址的偏移量(offset)都是 ...

  10. try{}catch{}finally{}的手记

    try{ System.out.println("执行try"); int = 6 / 0; return 1; }catch(Exception e){ System.out.p ...