mit-indiv09-dots
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).
InputThe first line of the input 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 [−10^9 10^9]
OutputTo the first line of the output write the maximum distance between one red and one blue dot with 3 decimal point precision.
Input:
Output:
5
1 1
3 3
5 4
4 2
5 7
6
2 1
3 4
3 2
2 3
1 2
2 5Output:
6.708Submit solution
Coming laterThe grading service will be connected in a later migration step. You can inspect the task and your previous results now.