Under construction

Still being built. Things may change

Aerobatics 2

Time limit1sMemory limit512 MB

Summary
Find a visiting order of N checkpoints so that the smallest turning angle at the intermediate checkpoints is as large as possible.
Level

Medium7 of 10

Topics
Geometry, Greedy
Solved
No attempts yet

Problem

Bitaro will take part in an aerobatics competition and fly an airplane. The airplane keeps a fixed altitude and passes through checkpoints on a coordinate plane. There are NN checkpoints, numbered 1 to NN. Checkpoint ii (1≤i≤N1 \le i \le N) is at (Xi,Yi)(X_i, Y_i).

The airplane must pass each checkpoint exactly once, as follows.

  1. Bitaro chooses the starting checkpoint. The airplane starts flying from there.
  2. Repeat the following N−1N-1 times. Bitaro chooses the next checkpoint from those not yet chosen, and the airplane flies straight from the current checkpoint to it.
  3. When the airplane reaches the last checkpoint, the flight ends.

In step 2, the starting checkpoint counts as already chosen. The airplane must fly straight from one checkpoint to the next. It may not draw a curve or turn partway along a segment.

The route is a polygonal line. The airplane changes direction at most N−2N-2 times. If the angle of the route at a checkpoint is small, the direction change there is large, which risks failing the flight.

Bitaro wants the minimum angle of the route at the N−2N-2 checkpoints other than the starting and last checkpoints to be as large as possible. Given the coordinates, find a visiting order that maximizes this minimum angle.

Input

The first line contains NN and Z0Z_0.

NZ0N Z_0

X1Y1X_1 Y_1

⋮\vdots

XNYNX_N Y_N

Each of the next NN lines contains the coordinates XiX_i and YiY_i of one checkpoint, separated by a space. Z0Z_0 is a parameter used by the grader.

Output

Print NN lines. The kk-th line contains PkP_k (1≤Pk≤N1 \le P_k \le N), the number of the kk-th checkpoint on the route. The starting checkpoint is P1P_1.

Constraints

  • 3≤N≤1 0003 \le N \le 1\,000.
  • Xi2+Yi2≤10 000 000\sqrt{X_i^2 + Y_i^2} \le 10\,000\,000 (1≤i≤N1 \le i \le N).
  • (Xi,Yi)≠(Xj,Yj)(X_i, Y_i) \ne (X_j, Y_j) (1≤i<j≤N1 \le i < j \le N).
  • 1≤Z0≤1791 \le Z_0 \le 179.

Examples1

  1. Example 1

    Input
    7 90
    3 1
    2 5
    0 2
    -1 6
    -3 1
    -1 -4
    4 -2
    
    Expected output
    5
    3
    1
    7
    6
    4
    2