acmsguru |
---|
Finished |
128. Snake time limit per test: 0.25 sec.
There are N points given by their coordinates on a plane. All coordinates (xi,yi) are integers in a range from -10000 up to 10000 inclusive . It is necessary to construct a broken line satisfying the following conditions:
Input First line contains the number N (4 <= N <= 10000) - amount of points. Each of the following N lines contains coordinates of points separated by space xi and yi (1 <= i <= N). Points are given in random order.
Output First line should contain the length of the broken line L or 0 if there is no solution.
Sample Input Sample Output 4 0 0 0 3 3 3 3 0
Sample Output 12 | ||||||
|
Name |
---|