You are given two disjoint sets of dots with their coordinates in the Cartesian coordinate
system, one set of red dots and one set of blue dots. You need to calculate the maximum
distance between two dots (one red and one blue).
The first line of the input contains an integer T, indicates the number of test cases.
The first line of each test case contains one positive integer N (1<=N<=100000) representing the number of red dots. Each of the next N lines contain two space-separated integers representing the coordinates of a red dot. The next line of the input contains one integer M (1<=M<=100000), the number of blue dots. Finally the next M lines contain two space-separated integers representing the coordinates of the blue dots. Each coordinate will be in the interval [-109, 109].
For each test case please output one line containing the maximum distance between one red and one blue dot with 3 decimal point precision.
1 5 1 1 3 3 5 4 4 2 5 7 6 2 1 3 4 3 2 2 3 1 2 2 5
6.708
Migrated from old NTUJ.
MIT Individual 2009
No. | Testdata Range | Score |
---|