Hell of Optimizing Geometric Construction
시간 제한2초메모리 제한2048 MB
각 점의 유일한 최근접 이웃이 n개 점을 한 바퀴 도는 순환이 되도록 정수 좌표 n개를 구성한다.
문제
One day, dnialh mentioned that optimizing geometric construction perfectly is not possible. Oh, very well. You will see about that.
You are given a positive integer such that . Please find a sequence of points on the plane, , satisfying the following constraints.
- The coordinates of each point are integers in the range .
- No two points share the same coordinates.
- For each , the closest point to other than itself is unique. Let the index of this unique point be .
- Let be a sequence of integers defined by and for . Then, is a permutation of .
It is proven that such a sequence of points exists under the constraints of this task.
입력
A positive integer is given on one line. ()
출력
Output lines. The -th line must contain and , the coordinates of , separated by a space. ()
힌트
In the samples, and .
Here, is determined as follows.
- Other than , the unique closest point to is . Therefore, .
- Other than , the unique closest point to is . Therefore, .
- Other than , the unique closest point to is . Therefore, .
- Other than , the unique closest point to is . Therefore, .
Now, one can manually verify that the resultant sequence is a permutation of . Therefore, the sequence of points satisfies the constraints.