|시간 제한||메모리 제한||제출||정답||맞은 사람||정답 비율|
|1 초||512 MB||4||3||3||75.000%|
There are N discs on a two dimensional field, and all of them are centered on different lattice points. These discs have an interesting arrangement, i.e. for every two different discs A and B, then either A is inside B or B is inside A (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 N center points remain. The time has come for you to reconstruct the discs in a better way: Each disc mush 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 A is inside B or B is inside A). Finally, the sum of all discs’ radii is minimum. Note that a disc’s radius can be 0, which is essentially a dot.
Given N 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 10−6.
Input begins with an integer: N (2 ≤ N ≤ 16) representing the number of center points. The next N lines, each contains two integers: xi yi (0 ≤ xi, yi ≤ 109) representing a center point at coordinate (xi, yi). You may safely assume that all the given center points are unique.
Output in a line the minimum possible sum of the discs’ radii which satisfies the requirement given in the problem statement.
3 1 1 2 1 3 1
Let the radii of the discs centered at (1, 1) be 0, at (2, 1) be 1, and at (3, 1) be 2.
3 5 5 0 0 10 0
Let the radii of the discs centered at (5, 5) be 5√2, at (0, 0) be 0, and at (10, 0) be 10√2.
4 5 1 5 5 5 6 5 8
Let the radii of the discs centered at (5, 1) be 7, at (5, 5) be 3, at (5, 6) be 2, and at (5, 8) be 0.