#d1901. 最小生成数
最小生成数
Minimum Spanning Tree
Problem Description
There are points, numbered from to . The weight of the edge between point and point is . Find the weight of the minimum spanning tree of these points.
Input Format
The first line contains an integer .
The following lines each contain one integer .
Output Format
One number: the answer.
Sample Input
2
2
6
Sample Output
0
26
Constraints
For all data, .