Discs
Time limit1sMemory limit512 MB
Assign nested discs to N given lattice centers and choose radii so every pair of discs is nested, minimizing the total radius sum.
- Level
Hard8 of 10
- Topics
- Geometry, Dynamic programming, Bit manipulation, Math
- Solved
- No attempts yet
Problem
There are discs on a two dimensional field, and all of them are centered on different lattice points. These discs have an interesting arrangement: for every two different discs and , either is inside or is inside (they may touch each other). Note that the shape of each disc is a circle.
Now, forget the discs, and you will see the truth! As you step forward into a new dimension, an astonishing and utterly new world arises as only the center points remain. The time has come for you to reconstruct the discs in a better way: Each disc must be centered at one of those center points, and each center point must be the center of exactly one disc. Every two different discs must satisfy the previous arrangement (i.e. either is inside or is inside ). Finally, the sum of all discs' radii is minimum. Note that a disc's radius can be 0, which is essentially a dot.
Given different lattice points, find the minimum possible sum for such discs' radii. Your answer will be considered as correct if it has an absolute or relative error less than .
Input
Input begins with an integer: () representing the number of center points. The next lines, each contains two integers: () representing a center point at coordinate . You may safely assume that all the given center points are unique.
Output
Output in a line the minimum possible sum of the discs' radii which satisfies the requirement given in the problem statement.