Problem A: Freckles
Input
The input begins with a single positive integer on a line by itself indicating the number of the cases following, each of them as described below. This line is followed by a blank line, and there is also a blank line between two consecutive inputs.The first line contains 0 < n <= 100, the number of freckles on Dick's back. For each freckle, a line follows; each following line contains two real numbers indicating the (x,y) coordinates of the freckle.
Output
For each test case, the output must follow the description below. The outputs of two consecutive cases will be separated by a blank line.Your program prints a single real number to two decimal places: the minimum total length of ink lines that can connect all the freckles.
Sample Input
1 3 1.0 1.0 2.0 2.0 2.0 4.0
Sample Output
3.41
minimum spanning tree: Prim's algorithm
沒有留言:
張貼留言