Under construction

Still being built. Things may change

Discs

Time limit1sMemory limit512 MB

Summary
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 NN 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 AA and BB, either AA is inside BB or BB is inside AA (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 NN 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 AA is inside BB or BB is inside AA). Finally, the sum of all discs' radii is minimum. Note that a disc's radius can be 0, which is essentially a dot.

Given NN 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−610^{-6}.

Input

Input begins with an integer: NN (2≤N≤162 \le N \le 16) representing the number of center points. The next NN lines, each contains two integers: xix_i yiy_i (0≤xi,yi≤1090 \le x_i, y_i \le 10^9) representing a center point at coordinate (xi,yi)(x_i, y_i). 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.

Examples3

  1. Example 1

    Input
    3
    1 1
    2 1
    3 1
    
    Expected output
    3.000000000
    
  2. Example 2

    Input
    3
    5 5
    0 0
    10 0
    
    Expected output
    21.213203436
    
  3. Example 3

    Input
    4
    5 1
    5 5
    5 6
    5 8
    
    Expected output
    12.000000000