#K85247. Round-robin Tournament Matches

    ID: 36599 Type: Default 1000ms 256MiB

Round-robin Tournament Matches

Round-robin Tournament Matches

You are given an integer N representing the number of teams in a tournament. Your task is to generate all possible matches for a round-robin tournament. A match is represented as a pair \((i, j)\) (written as two space-separated integers on one line) where \(1 \leq i < j \leq N\). The matches should be listed in lexicographical order.

Example:

Input: 4

Output: 1 2 1 3 1 4 2 3 2 4 3 4

</p>

If there is only one team, then there are no matches and the output should be empty.

inputFormat

The input consists of a single integer N on standard input.

Constraints:

  • \(1 \leq N \leq 10^4\)

outputFormat

Output all matches, each on a separate line. Each line should contain two space-separated integers \(i\) and \(j\) representing a match. If no match exists, output nothing.

## sample
1