Time Limit:1000MS     Memory Limit:10000KB     64bit IO Format:%I64d
& %I64u

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

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.

Hint

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.
#include <iostream>
#include<cmath>
using namespace std;
double PI=3.14 ;
int main()
{
int n,s;
double x,y;
cin>>n;
for(int i=1;i<=n;i++)
{
cin>>x>>y;
x = (x*x + y*y)* PI / 2 / 50;
s=x;
if(x-s>0)
s++; printf("Property %d: This property will begin eroding in year %d.\n", i, s); }
printf("END OF OUTPUT.\n");
return 0;}

D - I Think I Need a Houseboat(1.3.1)的更多相关文章

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

    I Think I Need a Houseboat Time Limit : 2000/1000ms (Java/Other)   Memory Limit : 65536/32768K (Java ...

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

  8. I Think I Need a Houseboat POJ - 1005

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

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

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

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

随机推荐

  1. explicit 显示的类型转换运算符

    C++提供了关键字explicit,可以阻止不应该允许的经过转换构造函数进行的隐式转换的发生.声明为explicit的构造函数不能在隐式转换中使用. 调用构造函数可以分为显示调用和隐式调用,当用赋值初 ...

  2. 【51nod】1851 俄罗斯方块

    题解 最近一遇到神仙题一卡就好久--做点水题滋养一下自己吧= = 显然我们发现放一个方块的奇偶性不会改变,所以格子如果黑格子是奇数,那么就是No 我们发现每个2 × 3的方格里的2 × 1的黑格子都可 ...

  3. Linux下 rz 和 sz 命令的安装与使用

    目录 Linux下 rz 和 sz 命令的安装与使用 rz/sz命令的安装 sz命令-发送文件到本地(下载): rz命令-本地上传文件到服务器(上传): 声明 Linux下 rz 和 sz 命令的安装 ...

  4. 全文搜索引擎 Elasticsearch (一)

    一.安装 Elastic 需要 Java 8 环境.如果你的机器还没安装 Java,可以参考这篇文章,注意要保证环境变量JAVA_HOME正确设置. 安装完 Java,就可以跟着官方文档安装 Elas ...

  5. MySQL 关于存储过程那点事

    存储例程是存储在数据库服务器中的一组sql语句,通过在查询中调用一个指定的名称来执行这些sql语句命令. 简介 SQL语句需要先编译然后执行,而存储过程(Stored Procedure)是一组为了完 ...

  6. 1go基本语法

    // week1 project main.go//导入一个包(目录) package main //导入方法 import "fmt" //createMessage函数(参数, ...

  7. leetcode 相交链表 python实现

    这道题 要想解决其实不难, 开两层循环进行遍历就能实现,但是会超时 如果想要O(n) 的时间复杂度, 我考虑用哈希表来存储遍历过的元素,如果发现当前遍历的元素在哈希表里,那说明交叉点就在这 这里利用了 ...

  8. 在Windows上安装FFmpeg程序

    原文地址:http://helloway.blog.51cto.com/7666282/1642247 FFmpeg是一套可以用来记录.转换数字音频.视频,并能将其转化为流的开源计算机程序.它提供了录 ...

  9. luoguP2303 [SDOI2012]Longge的问题 化式子

    求\(\sum \limits_{i = 1}^n gcd(i, n)\) \(\sum \limits_{i = 1}^n gcd(i, n)\) \(=\sum \limits_{i = 1}^n ...

  10. Go Web编程 第四章--处理请求

    请求和响应 Request结构 URL字段 Header字段 Body字段 Form, PostForm, MultipartForm字段 在处理器函数中,我们可以通过Request获取各个字段的详细 ...