Farm

아직 제출이 없습니다시간 제한1초메모리 제한1024 MB

문제

There is a farm that may be treated as two-dimensional Euclidean plane. There are nn trees numbered 1,2,,n1, 2, \dots, n. Each tree may be treated as a point on the plane, and the ii-th tree has coordinates (x_i,y_i)(x\_i,y\_i). The coordinates of trees are pairwise distinct.

Mr. P will drive from the origin (0,0)(0,0). In one round, Mr. P will choose a direction from left, right, up, 45 degrees upper left, and 45 degrees upper right such that if driving in the selected direction Mr. P can arrive at a tree he has never visited. Mr. P will drive straight along the selected direction and will arrive at the nearest unvisited tree in that direction. If there is no available direction, Mr. P will stop. Mr. P will follow the optimal route in the sense Mr. P will visit the most trees possible. If the optimal route is not unique, Mr. P may choose any one of them.

Unfortunately, Mr. S found that Mr. P's car will leave a rut on the farm. A rut may be treated as a line segment between two trees or between the origin and a tree.

There are a lot of visitors to the farm besides Mr. P, and they will choose an optimal route when visiting the trees. Mr. S believes ruts in directions other than left and right (i.e. up, 45 degrees upper left, or 45 degrees upper right) are not beautiful. Therefore, he will rent some road rollers to reinforce areas that might have ruts not in the left or right direction. More formally, the area that might have ruts not in the left or right direction are segments on the farm such that each segment is contained in some optimal route. The road rollers work as follows:

  • The road roller starts from the origin or any tree.
  • The road roller may move upwards, 45 degrees upper left, or 45 degrees upper right. The road roller may only stop or change direction under a tree.
  • The road roller may only pass through areas that may have ruts not in the left or right direction, but a given area may be passed by multiple road rollers.

Mr. P and Mr. S asks the following question: (1) find an optimal route for Mr. P (2) tell Mr. S the minimum number of road rollers required.

입력

The first line of the input contains an integer nn denoting the number of trees. In the following nn lines, the (i+1)(i+1)-th line has two integers x_i,y_ix\_i, y\_i separated by a single space denoting the coordinate of ii-th tree.

출력

The output contains 3 lines. The first line is an input mm denoting the maximum number of trees Mr. P may visit. The second line contains mm integers separated by a single space denoting the trees Mr. P shall visit. The third line contains a single integer denoting the minimum number of road rollers required.

제한

Test Casennx_i,y_ix\_i, y\_iAdditional Constraints
1n=5n=5x_i100\|x\_i\| \le 100 0<y_i1000 < y\_i \le 100 
2n=10n=10
3n=100n=100x_i10,000\|x\_i\| \le 10\\,000 0<y_i10,0000 < y\_i \le 10\\,000
4n=1000n=1000
5n=5000n=5000x_i1,000,000\|x\_i\| \le 1\\,000\\,000 0<y_i1,000,0000 < y\_i \le 1\\,000\\,000The optimal route is unique.
6
7n=50,000n=50\\,000
8n=5000n=5000x_i1,000,000\|x\_i\| \le 1\\,000\\,000 0<y_i1,000,0000 < y\_i \le 1\\,000\\,000All y_iy\_i are unique.
9n=50,000n=50\\,000
10
11n=5000n=5000x_i1,000,000\|x\_i\| \le 1\\,000\\,000 0<y_i1,000,0000 < y\_i \le 1\\,000\\,000For any integer YY, at most 10001000 trees satisfy y_i=Yy\_i = Y. Additionally, there exists an optimal solution such that the road rollers won't pass through the same place twice.
12
13n=50,000n=50\\,000
14
15n=10,000n=10\\,000x_i1,000,000,000\|x\_i\| \le 1\\,000\\,000\\,000 0<y_i1,000,000,0000 < y\_i \le 1\\,000\\,000\\,000For any integer YY, at most 10001000 trees satisfy y_i=Yy\_i = Y.
16
17n=30,000n=30\\,000
18
19n=50,000n=50\\,000
20