Aerobatics 6
Time limit1sMemory limit512 MB
Given N checkpoints in the plane, find a visiting order whose polyline has the largest possible minimum turning angle at its inner checkpoints.
Problem
Bitaro will take part in an aerobatics competition and fly an airplane. The airplane keeps a constant altitude and passes through checkpoints. The flight area is treated as a coordinate plane. There are checkpoints, numbered 1 to . Checkpoint has coordinates .
The flight proceeds as follows.
- Bitaro chooses the starting checkpoint, and the airplane takes off from there.
- Repeat the following times. Bitaro chooses the next checkpoint from those not yet chosen. The airplane then flies straight from the current checkpoint to the next one.
- When the airplane reaches the last checkpoint, the flight ends.
In step 2, the starting checkpoint counts as already chosen. The airplane must fly in a straight line between checkpoints. Drawing a curve or turning in the middle of a leg is forbidden.
The route is a polygonal line. The airplane changes direction at most times. At a checkpoint where the angle of the polygonal line is small, the direction change is large, which risks failing the flight.
Bitaro wants the minimum angle of the polygonal line at the checkpoints other than the starting and last checkpoints to be as large as possible. Given the checkpoint coordinates, find a visiting order that maximizes this minimum angle.
Input
The first line contains and . is a parameter used by the grader. Each of the next lines contains and .
Output
Print lines. The -th line contains (), the number of the -th checkpoint on the route. The starting checkpoint is .
Constraints
- ()
- ()