#P1632. 点的移动

点的移动

Description

There are NN points with integer coordinates on the plane. Moving point (x0,y0)(x_0, y_0) to (x1,y1)(x_1, y_1) costs x0x1+y0y1|x_0-x_1|+|y_0-y_1|. For each KK (K=1,,NK = 1, \cdots, N), find the minimum total cost to make KK points coincide at the same position.

Input Format

The first line contains a positive integer NN.

The next NN lines each contain two positive integers xix_i and yiy_i, the coordinates of the ii-th point, each not exceeding 10610^6.

Constraints: For 100%100\% of the testdata, 1N501 \le N \le 50.

Output Format

Output NN lines. The ii-th line is the minimum total cost to make ii points coincide at the same position.

4
15 14
15 16
14 15 
16 15
0
2
3
4

Hint

Translated by ChatGPT 5