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. Java基础学习-HelloWorld案例常见问题

    注意:控制台曾经写过的命令,我们可以通过上下箭头进行选择,不需要重新进行输入,以节省时间,提高效率.   1.单词拼写问题     -class    不要写成Class     -String    ...

  2. Springboot学习笔记(一)-线程池的简化及使用

    工作中经常涉及异步任务,通常是使用多线程技术,比如线程池ThreadPoolExecutor,它的执行规则如下: 在Springboot中对其进行了简化处理,只需要配置一个类型为java.util.c ...

  3. FastJson中JSONObject用法及常用方法总结

    本文为博主原创,未经允许不得转载: 最近一直有用到解析各种数据,主要是用FastJson进行数据解析,其中一个重要的类为JSONObject,今天有时间,所以进行总结一下: JSONobject是Fa ...

  4. 01.什么是Vue.js

    VUE.JS 什么是Vue.js Vue.js 是目前最火的一个前端框架,React是最流行的一个前端框架(React除了开发网站,还可以开发手机App, Vue语法也是可以用于进行手机App开发的, ...

  5. Rails-Treasure chest2 嵌套表单;

    嵌套表单1-1 嵌套表单1-多 选日期时间的UI (一个jquery Plugin) 拆除前后台css和js Rich Editor, 显示输入的HTML tag 批次编辑/删除 嵌套表单1-1 核心 ...

  6. XXX系统业务建模

    1.识别业务参与者 参与者包括管理员.填报人员.审核人员和领导.          2.识别业务用例(用例图展现) 3.详述业务用例(填报需求这一用例,以活动图详细展现如下) 4.建立业务对象模型

  7. tensorflow world language model

    上文提到了pytorch里的world language model,那么怎么能不说tensorflow的实现呢,还是以tensorflow ptb的代码为例说说. 地址: https://githu ...

  8. NAT资料

    第1章 NAT 1.1 NAT概述 1990年代中期,NAT是作为一种解决IPv4地址短缺以避免保留IP地址困难的方案而流行起来的.网络地址转换在很多国家都有很广泛的使用.所以NAT就成了家庭和小型办 ...

  9. nginx优化参考

    参考链接:http://blog.sina.com.cn/s/blog_4f9fc6e10102uxib.html 计算访问路径频度 awk -r|more |grep /路径 ps print &a ...

  10. Django进阶之CSRF

    简介 django为用户实现防止跨站请求伪造的功能,通过中间件 django.middleware.csrf.CsrfViewMiddleware 来完成.而对于django中设置防跨站请求伪造功能有 ...