Total Circle
Time limit1sMemory limit256 MB
Given point sets P and Q, find the largest squared radius among centers in Q whose minimum enclosing circle of P is as small as possible.
- Level
Medium7 of 10
- Topics
- Geometry, Brute force, Math, Binary search
- Solved
- No attempts yet
Problem
On the coordinate plane there are point arrays and . Consider a circle centered at a point of that contains every point of , and take the one with the smallest area. Find the maximum possible radius of such a circle.
Input
The first line gives and . ($1 \le N, M \le 1000)
The next lines give and , meaning . ($-10^6 \le x, y \le 10^6)
The next lines give and , meaning . ($-10^6 \le x, y \le 10^6)
Output
Print the square of the maximum possible radius of a smallest-area circle that is centered at a point of and contains every point of .