编程介的小学生 2017-08-31 08:44 采纳率: 20.5%
浏览 726
已采纳

Reforestation

The government is making strenuous efforts to reforest the hill. To trace the growing status of the trees, an observer is placed in the middle of the area at the coordinate (0, 0). To simplify our model, let us assume that:
1. the observer has a diameter of 0;
2. the trees have a radius of 0 at the very beginning;
3. all the trees will grow in the same speed until they are stopped for the reasons that if it touches either the observer or another tree.
Let us say that the trees' radius will grow 1 unit length per unit time. So the radius of a tree at the time T would be T if it had not been stopped by then.

What we are interested in here is that when the observer will lose sight on the skyline. Or we put it in the words that the observer could not see anything outside the forest in any horizontal directions.

Input

The first line of the input contains an integer T, T < 150, which is the number of test cases.
In each test case, there is a positive integer N, in the range [1, 200], which is the number of trees. The next N lines each has two integers Xi and Yi indicating the coordinates of the i-th tree. The values of the coordinates are between -10,000 and 10,000 inclusively. All the trees and the observer have different positions.

Output

For each test case, output the time that the observer would lose the sight of the sky. The answer be accurate up to six decimal places. If the observer will never be blocked by the trees, you should output "-1.0" instead.
A relative error of 1e-6 will be accepted.

Sample Input

2
2
0 1
0 -2
3
1 0
0 1
0 -1
Sample Output

2.000000
-1.0

  • 写回答

1条回答

  • threenewbee 2017-09-15 15:45
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题