Limits 1s, 512 MB

In this year's RoboFest, there a segment called LFR(Line Follower Robot) contest. An LFR contest is a contest where the robots have to follow a specific line. The fastest one to reach the finishing point wins.

In this contest, there is a rule that all the robots have to be circular. The track is bound by an inner and an outer polygon. More clearly, the space between the two polygons was the track. Now, to make the contest easier, the authority created glass walls along with the lines of the polygons so that no robot gets out of the track.

You are planning to take an LFR in this contest. One of your strategies is to make the robot as big as possible.

Now, given the coordinates of the points of both polygon in consecutive order (clockwise or counterclockwise), You'll have to find the biggest diameter possible for your robot so that it does not get stuck anywhere in the track (does not get stuck between walls).

Input

First line of the input contains T(0 < T < 101), number of test cases.

Each test case starts with an integer Ni(2 < Ni < 101 ), number of points of the inner polygon.
The next Ni lines contains two integer each. Xi , Yi denoting coordinates of the points in the inner polygon.

Then comes another integer No(2 < No < 101), number of points in the outer polygon.
The next No lines contains two integer each. Xi, Yi denoting coordinates of the point in the outer polygon.

All coordinates have absolute value no larger than 1000. The points of the polygons can be given in either clockwise or counterclockwise order and the two polygons do not intersect or touch themselves. The outer polygon encloses the inner polygon.

Output

For each test case, print a line containing a floating-point number rounded up to 6 digits after decimal point, denoting the maximal diameter possible for the robot.

Sample

InputOutput
2 
4 
-5 -5 
5 -5 
5 5 
-5 5 
4 
-10 -10 
-10 10 
10 10 
10 -10 
3 
0 0 
1 0 
1 1 
5 
3 -3 
3 3 
-4 2 
-1 -1 
-2 -2
5.000000
1.414214

Submit

Login to submit.

Statistics

71% Solution Ratio
mridul_sustEarliest, Dec '19
rebornFastest, 0.0s
eftikhar_azimLightest, 0 B
rebornShortest, 2270B
Toph uses cookies. By continuing you agree to our Cookie Policy.