#P6362. 平面欧几里得最小生成树
平面欧几里得最小生成树
Description
There are points on a plane. The coordinates of point are . The edge weight between points and is . Find the sum of edge weights of the minimum spanning tree.
Input Format
The first line contains an integer .
The next lines each contain two integers .
Output Format
Output one line with a real number, representing the answer.
Your output will be considered correct if the absolute error or relative error compared to the standard output is within .
4
0 0
1 2
-1 2
0 4
6.472136
Hint
Sample Explanation 1
In this sample, the minimum spanning tree is shown in the figure below:

The sum of edge weights is .
Constraints
- For of the testdata, .
- For of the testdata, , , .
Translated by ChatGPT 5
京公网安备 11011102002149号