I think I need a boat house.

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.

Solution:

include<stdio.h>
include<math.h>
define PI 3.1415927
int main(){
int n,year;
int i=1;
double s,x,y,redius;
scanf("%d",&n);
while(n--){
scanf("%lf %lf",&x,&y);
redius=x*x+y*y;
s=PI*redius/2.0;
year=(int)ceil(s/50.0);
printf("Property %d: This property will begin eroding in year %d.\n",i++,year);
}
printf("END OF OUTPUT.");
return 0;
}

I think I need a boat house的更多相关文章

  1. Lesson 20 One man in a boat

    Text Fishing is my favourite sport. I often fish for hours without catching anything. But this does ...

  2. 【软件分析与挖掘】BOAT: An Experimental Platform for Researchers to Comparatively and Reproducibly Evaluate Bug Localization Techniques

    摘要: 目前有许多的bug定位技术,但是,由于他们基于不同的数据集,而且有些数据集还不是公开的,甚至有些技术只应用于小数据集,不具有通用性,因此,不好比较这些技术之间的优劣. 因此,BOAT应运而生. ...

  3. HDU 4902 Nice boat (线段树)

    Nice boat 题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=4902 Description There is an old country a ...

  4. HDU-4902 Nice boat

    Nice boat Time Limit: 30000/15000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Tot ...

  5. 【HDU】4092 Nice boat(多校第四场1006) ——线段树 懒惰标记

    Nice boat Time Limit: 30000/15000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others) To ...

  6. 线段树 + 区间更新 ----- HDU 4902 : Nice boat

    Nice boat Time Limit: 30000/15000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Tot ...

  7. UOJ#204 【APIO2016】Boat

    Time Limit: 70 Sec  Memory Limit: 256 MBSubmit: 559  Solved: 248 Description 在首尔城中,汉江横贯东西.在汉江的北岸,从西向 ...

  8. C++练习--创建Boat类和Car类(含友元)

    /* 定义Boat与Car两个类,二者都有weight属性, 定义二者的一个友元函数totalWeight()为外部函数, 计算二者的重量和. */ #include<iostream> ...

  9. hdu 4902 Nice boat(线段树区间改动,输出终于序列)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4902 Problem Description There is an old country and ...

随机推荐

  1. 深度学习标注工具 LabelMe 的使用教程(Windows 版本)

    深度学习标注工具 LabelMe 的使用教程(Windows 版本) 2018-11-21 20:12:53 精灵标注助手:http://www.jinglingbiaozhu.com/ LabelM ...

  2. udp套接字及利用socketserver模块实现并发以及并发编程

    一:基于udp协议(数据报协议)的套接字:和tcp协议的套接字对比而言,由于udp是无链接的,所以先启动哪一端都不会报错,而且udp也不会有粘包 现象,所以对比下来,tcp协议的话传输数据更加可靠,但 ...

  3. leecode第二百零六题(反转链表)

    /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode ...

  4. leecode第一百五十五题(最小栈)

    class MinStack { public: stack<int> cur_stack; stack<int> cur_min;//用来存储最小值的栈 int min_nu ...

  5. querySelector() 方法

    返回文档中匹配指定 CSS 选择器的一个元素. 虽然IE8中没有getElementsByClassName()但可以用querySelector()代替 注意: querySelector() 方法 ...

  6. Regex-Golf

    A man, a plan: 判断回文,如果不确定串长度情况下可以考虑利用反向引用构造pattern,例如: (.)\1  , (.)(.)\2\1 , (.)(.)(.)\3\2\1 ...但这里只 ...

  7. ubuntu14.04安装 Apache2 并配置https

    一.安装 Apache2 sudo apt-get update sudo apt-get install apache2 安装完apache2,默认根目录在/var/www/html 下,点击其下的 ...

  8. ADO.NET 中的五个主要对象

    Connection:主要用来开启程序和数据库的连接 Command:主要是用来对数据库发出一些指令,. DataAdapter;主要在数据源以及DataSet之间执行数据库的传输工作 DataSet ...

  9. ionic1 添加百度地图插件 cordova-plugin-baidumaplocation

    cordova-plugin-baidumaplocation 这个插件返回的数据是 json 格式的  可以直接获取  android 和 ios 都可用 1.先去百度地图平台去创建应用  获取访问 ...

  10. Android:layout属性大全

    Android layout属性大全 第一类:属性值 true或者 false android:layout_centerHrizontal 水平居中android:layout_centerVert ...