#P1632. 点的移动
点的移动
Description
There are points with integer coordinates on the plane. Moving point to costs . For each (), find the minimum total cost to make points coincide at the same position.
Input Format
The first line contains a positive integer .
The next lines each contain two positive integers and , the coordinates of the -th point, each not exceeding .
Constraints: For of the testdata, .
Output Format
Output lines. The -th line is the minimum total cost to make points coincide at the same position.
4
15 14
15 16
14 15
16 15
0
2
3
4
Hint
Translated by ChatGPT 5
京公网安备 11011102002149号