시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 512 MB125814878.689%

문제

Rock-paper-scissors is a game played between two players, where each player chooses one of three elements: rock, paper or scissors. The rules are simple: rock-beats-scissors, scissors-beats-paper and paper-beats-rock. If the players choose the same element, then they tie. On the television show The Big Bang Theory, Sheldon extended rock-paper-scissors to include two extra elements: Lizard and Spock.

The rules are scissors-cuts-paper, paper-covers-rock, rock-crushes-lizard, lizard-poisons-Spock, Spock-smashes-scissors, scissors-decapitates-lizard, lizard-eats-paper, paper-disproves-Spock, Spock-vaporizes-rock and rock-crushes-scissors.

Sheldon’s setup is valid since each element beats exactly half of the other elements and loses to the remaining half. Whenever the number of elements is odd, it is possible to find a game that satisfies these criteria. Extend the game to n elements.

입력

The input consists of a single line with one integer n (3 ≤ n ≤ 99), which is the number of elements. It is guaranteed that n is odd.

출력

Display one valid extension of rock-paper-scissors to n elements. Display exactly n(n−1)/2 lines containing two integers each, b and c (b ≠ c), indicating that element b beats element c. The elements are numbered 1, 2, . . . , n.

For each pair of distinct elements, x and y, exactly one of ‘x y’ or ‘y x’ should be displayed. The lines may be displayed in any order. If there are multiple solutions, any one will be accepted.

예제 입력 1

3

예제 출력 1

1 2
2 3
3 1

예제 입력 2

5

예제 출력 2

1 2
1 4
2 3
2 4
3 1
3 5
4 3
4 5
5 1
5 2

출처

ICPC > Regionals > South Pacific > South Pacific Region > 2017 ACM South Pacific Programming Contest E번

  • 문제의 오타를 찾은 사람: reversing