CF1886B.Fear of the Dark
普及/提高-
通过率:0%
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
Monocarp tries to get home from work. He is currently at the point O=(0,0) of a two-dimensional plane; his house is at the point P=(Px,Py) .
Unfortunately, it is late in the evening, so it is very dark. Monocarp is afraid of the darkness. He would like to go home along a path illuminated by something.
Thankfully, there are two lanterns, located in the points A=(Ax,Ay) and B=(Bx,By) . You can choose any non-negative number w and set the power of both lanterns to w . If a lantern's power is set to w , it illuminates a circle of radius w centered at the lantern location (including the borders of the circle).
You have to choose the minimum non-negative value w for the power of the lanterns in such a way that there is a path from the point O to the point P which is completely illuminated. You may assume that the lanterns don't interfere with Monocarp's movement.
The picture for the first two test cases
输入格式
The first line of the input contains one integer t ( 1≤t≤104 ) — the number of test cases.
Each test case consists of three lines:
- the first line contains two integers Px and Py ( −103≤Px,Py≤103 ) — the location of Monocarp's house;
- the second line contains two integers Ax and Ay ( −103≤Ax,Ay≤103 ) — the location of the first lantern;
- the third line contains two integers Bx and By ( −103≤Bx,By≤103 ) — the location of the second lantern.
Additional constraint on the input:
- in each test case, the points O , P , A and B are different from each other.
输出格式
For each test case, print the answer on a separate line — one real number equal to the minimum value of w such that there is a completely illuminated path from the point O to the point P .
Your answer will be considered correct if its absolute or relative error does not exceed 10−6 — formally, if your answer is a , and the jury's answer is b , your answer will be accepted if max(1,b)∣a−b∣≤10−6 .
输入输出样例
输入#1
2 3 3 1 0 -1 6 3 3 -1 -1 4 3
输出#1
3.6055512755 3.2015621187