The closest pair of points problem is a well-known problem in computational geometry. In this problem, you are given

points on the Euclidean plane, and you need to find a pair of points with the smallest distance between them.
Now, Claris, the brilliant one who has participated in programming contests for several years, is trying to solve a harder problem named the closest pair of segments problem, which also has a quite simple description as above.
However, the problem seems too hard, even for Claris, and she is asking you for help.
Now

segments are lying on the Euclidean plane. You have to pick two different segments, and then pick a point on each of them. Do it in such a way that the distance between these two points is the minimum possible.
For simplicity, no two given segments share a common point. Also, you don't need to show her the two points: just find the minimum possible distance between them instead.
输入描述:
The input contains several test cases, and the first line contains a single integer
(
): the number of test cases.
For each test case, the first line contains one integer
(
), which is the number of segments on the Euclidean plane.
The following
lines describe all the segments lying on the Euclidean plane. The
-th of these lines contains four integers,
,
,
, and
, describing a segment that connects
and
, where
.
It is guaranteed that, in each test case, the two endpoints of each segment do not coincide, and no two segments share a common point.
It is also guaranteed that the sum of
in all test cases does not exceed
.
输出描述:
For each test case, output a line containing a single real number: the answer to the closest pair of segments problem with an absolute or relative error of at most
.
Precisely speaking, assume that your answer is
and and the jury's answer is
. Your answer will be considered correct if and only if
.
示例1
输入
复制
2
2
0 1 1 2
1 1 2 0
2
0 1 1 2
2 2 3 1
输出
复制
0.707106781185
1.000000000001