Building the Constellation

Time limit1sMemory limit128 MB

Problem

Dohyun is the god of the universe. He wants to connect $n$ stars scattered across a two-dimensional plane with line segments to form a single constellation.

The constellation must satisfy the following two conditions:

  • Each line of the constellation is a straight segment joining two distinct stars.
  • Every star must be connected to every other star, directly or indirectly, through these lines.

Drawing one line costs the Euclidean distance between the two stars it joins. Find the minimum total cost of building a constellation that connects all of the stars.

Input

The first line contains the number of stars $n$. ($1 \le n \le 100$)

Each of the next $n$ lines contains the $x$ and $y$ coordinates of a star. Every coordinate is a positive real number not exceeding $1000$, given with at most two digits after the decimal point.

Output

Print the minimum cost of building the constellation, rounded to exactly two digits after the decimal point.