#abc348b. B - Farthest Point

B - Farthest Point

Score: 200200 points

问题陈述

xyxy 平面上,有 NN 个点,它们的 ID 编号从 11NN。点 ii 位于坐标 (Xi,Yi)(X_i, Y_i),并且没有两个点的坐标是相同的。

从每个点出发,找出最远的点,并打印出它的 ID 编号。如果有多个点是最远的,打印出这些点的 ID 编号中最小的一个。

在这里,我们使用欧几里得距离:对于两个点 (x1,y1)(x_1,y_1)(x2,y2)(x_2,y_2),它们之间的距离是 (x1x2)2+(y1y2)2\sqrt{(x_1-x_2)^{2}+(y_1-y_2)^{2}}

以上为大语言模型 kimi 翻译,仅供参考。

Problem Statement

On the xyxy-plane, there are NN points with ID numbers from 11 to NN. Point ii is located at coordinates (Xi,Yi)(X_i, Y_i), and no two points have the same coordinates.

From each point, find the farthest point and print its ID number. If multiple points are the farthest, print the smallest of the ID numbers of those points.

Here, we use the Euclidean distance: for two points (x1,y1)(x_1,y_1) and (x2,y2)(x_2,y_2), the distance between them is (x1x2)2+(y1y2)2\sqrt{(x_1-x_2)^{2}+(y_1-y_2)^{2}}.

Constraints

  • 2N1002 \leq N \leq 100
  • 1000Xi,Yi1000-1000 \leq X_i, Y_i \leq 1000
  • (Xi,Yi)(Xj,Yj)(X_i, Y_i) \neq (X_j, Y_j) if iji \neq j.
  • All input values are integers.

Input

The input is given from Standard Input in the following format:

NN

X1X_1 Y1Y_1

X2X_2 Y2Y_2

\vdots

XNX_N YNY_N

Output

Print NN lines. The ii-th line should contain the ID number of the farthest point from point ii.

Sample Input 1

4
0 0
2 4
5 0
3 4

Sample Output 1

3
3
1
1

The following figure shows the arrangement of the points. Here, PiP_i represents point ii. The farthest point from point 11 are points 33 and 44, and point 33 has the smaller ID number.

The farthest point from point 22 is point 33.

The farthest point from point 33 are points 11 and 22, and point 11 has the smaller ID number.

The farthest point from point 44 is point 11.

Sample Input 2

6
3 2
1 6
4 5
1 3
5 5
9 8

Sample Output 2

6
6
6
6
6
4