This page is still under construction.

Parts of this page are still being built. What you see may change.

Easter Eggs

Time limit2sMemory limit512 MB

Summary
Choose a red egg set and a blue egg set from given plants, total N eggs, maximizing the minimum red-blue distance.
Level

Hard8 of 10

Topics
Binary search, Graph, Union-find, Geometry
Solved
No attempts yet

Problem

Easter is coming, and the Easter Bunny decided to organise a chocolate egg hunt for the children. He hides two kinds of eggs: blue milk chocolate eggs and red dark chocolate eggs. The field holds blueberry plants and redberry plants, and the eggs go into those plants. A red egg has to go into a redberry plant and a blue egg into a blueberry plant.

The local government issued a permit for the event on the condition that exactly NN eggs are hidden. The government does not pay for the dental care of the local children, so the Bunny decides by himself how many eggs of each colour to hide.

By the yearly tradition, the first child to find both a red egg and a blue egg wins a big reward. To make the hunt as hard as possible, the Bunny wants to maximise the minimum distance between a red egg and a blue egg. To keep things fair, he hides at most one egg in each plant. Write a program that computes this value for him. Distances are Euclidean.

Input

The first line contains three integers NN, BB, RR: the number of eggs to hide, the number of blueberry plants, and the number of redberry plants.

Each of the next BB lines contains two integers xx, yy, the coordinates of a blueberry plant.

Each of the next RR lines contains two integers xx, yy, the coordinates of a redberry plant.

  • N≤250N \le 250
  • B<NB < N, R<NR < N
  • N≤B+RN \le B + R
  • −104≤x,y≤104-10^4 \le x, y \le 10^4
  • The B+RB + R plants have pairwise distinct coordinates.

Output

Print on the first line the largest minimum distance DD between a red egg and a blue egg that the Bunny can achieve. Print DD rounded to exactly six digits after the decimal point.

Figure

The picture shows the second example input. The eggs are hidden in the four filled plants.

Examples3

  1. Example 1

    Input
    3 2 2
    0 0
    1 0
    2 0
    3 0
    
    Expected output
    2.000000
    
  2. Example 2

    Input
    4 3 3
    0 0
    1 2
    -1 2
    0 1
    -1 -1
    1 -1
    
    Expected output
    3.000000
    
  3. Example 3

    Input
    2 1 1
    -10000 -10000
    10000 10000
    
    Expected output
    28284.271247