Masala A
Perfectionist
There are n points on the plane. You can move a point from a coordinate to the coordinate за стоимость, равную
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.
The first line contains an integer — number of points . Next in the lines list the coordinates of these pointsand — integers, modulo not exceeding
Print the minimum total distance to which the points should be dragged, with an absolute or relative error of no more than
# | input.txt | output.txt |
---|---|---|
1 |
4 0 0 0 1 1 1 1 0 |
1.414214 |