#BS0000449. Trứng Phục Sinh (Easter Eggs)
Bài tập thuộc lộ trình
Mục lục đề ⌄
Trứng Phục Sinh (Easter Eggs)
Easter Eggs
Source: Kattis
Version: Phuoc Hung OJ Extended
Problem Statement
An Easter egg hunt uses blue bushes and red bushes. A blue egg may only be placed at a blue bush, and a red egg at a red bush. At most one egg fits at each bush. Place exactly eggs, choosing the number of each colour freely. The score is the smallest Euclidean distance between a selected blue bush and a selected red bush. Maximise this score. Since and , both colours must occur.
Input
The first line contains integers . The next lines give integer coordinates of the blue bushes, followed by lines of red bush coordinates.
Output
Print the maximum score as a real number with absolute error at most . Use at least six decimal digits for sufficient precision.
Subtasks
- Subtask 1 (20 points): , , ; ; all coordinates are integer and all points are distinct.
- Subtask 2 (30 points): , , ; ; all coordinates are integer and all points are distinct.
- Subtask 3 (50 points): , , ; ; all coordinates are integer and all points are distinct.
Examples
Input 1
3 2 2
0 0
1 0
2 0
3 0
Output 1
2.000000000000000
Explanation 1
Choose both blue bushes and red bush . The minimum is 2. Above 2 only the cross-colour pair is possible, so three eggs cannot be placed.
Input 2
4 3 3
0 0
1 2
-1 2
0 1
-1 -1
1 -1
Output 2
3.000000000000000
Explanation 2
Select the four bushes . The two vertical pairs have distance 3. Above 3 neither central bush can coexist with any opposite-colour bush, and both vertical pairs are forbidden. Four selections are impossible.
