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. The Clocks

    The Clocks 题目链接:http://poj.org/problem?id=1166 题意:给出9个时钟的初始状态,问最少通过几次操作,能使每个时钟指向12点(每次操作都会使对应时钟顺时针旋转 ...

  2. 跑github上的Symfony项目遇到的问题

    Loading composer repositories with package information Installing dependencies (including require-de ...

  3. 转:AFNetworking 与 UIKit+AFNetworking 详解

    资料来源 : http://github.ibireme.com/github/list/ios GitHub : 链接地址 简介 : A delightful iOS and OS X networ ...

  4. web service client端调用服务器接口

    打开项目的web service client 其中wsdl URL    http://www.51testing.com/html/55/67755-848510.html 去这里面查找一些公开的 ...

  5. Git 的版本库创建和修改

    什么是版本库呢?版本库又名仓库,英文名repository,你可以简单理解成一个目录,这个目录里面的所有文件都可以被Git管理起来,每个文件的修改.删除,Git都能跟踪,以便任何时刻都可以追踪历史,或 ...

  6. 华硕笔记本进pe之前的设置

    1.开机的时候长按F2键进入BIOS界面,通过方向键进[Secure]菜单,通过方向键选择[Secure Boot Control]选项,将其设定为 "Disabled"2.通过方 ...

  7. unity3D中重要函数

    Update 当MonoBehaviour启用时,其Update在每一帧被调用. LateUpdate 当Behaviour启用时,其 LateUpdate在每一帧被调用. FixedUpdate 当 ...

  8. 重载operator<<

    学习<深入探索>时,发现原文中提供的一个代码大致如下(书中第3页) class Point3d { inline ostream& operator <<(ostrea ...

  9. informix 存储过程结构

    1.简介         存储过程(Stored Procedure)是一组为了完成特定功能的SQL语句集,经编译后存储在数据库中.用户通过指定存储过程的名字并给出参数(如果该存储过程带有参数)来执行 ...

  10. 负载均衡lvs_dr_tcp_http单调度

    准备三台虚拟,均为CentOS6.5 x86_64注意,配置过程中,保持端口的一致性.director (eth0 192.168.1.189, vip eth0:0: 192.168.1.18) D ...