Waterpipe - 2
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
In the plan area is depicted N cottages, which have known coordinates X, Y (i = 1 .. N). What is the minimum length should be the total length of water pipes that connects all the houses N of the town, directly or through several intermediate houses?
Input
The first line number N - the number of houses. The next N lines coordinates cottages X, Y (i = 1 .. N). All input values are natural numbers not greater than 100.
Output
Single number - the total length of water pipes, rounded to integers.
Examples
Input #1
Answer #1
Submissions 1K
Acceptance rate 41%