Masala A

Xotira 131 MB Vaqt 2000 ms
14

Perfectionist

There are n points on the plane. You can move a point from a coordinate (x1,y1)(x_1, y_1)  to the coordinate (x2,y2)(x_2, y_2) за стоимость, равную  (x1x2)2+(y1y2)2\sqrt{(x_1 - x_2)^2 + (y_1 - y_2) ^ 2}

Your task is to minimize the total cost of moving all points in such a way that they lie on the same straight line. Note that you can move the points in any way you like.
 


Kiruvchi ma'lumotlar:

The first line contains an integer nn — number of points (2<=n<=103)(2 <= n <= 10^3). Next in nn  the lines list the coordinates of these pointsxix_iand yiy_i — integers, modulo not exceeding  10610^6


Chiquvchi ma'lumotlar:

Print the minimum total distance to which the points should be dragged, with an absolute or relative error of no more than 10610^{-6}


Misollar
# input.txt output.txt
1
4
0 0
0 1
1 1
1 0
1.414214