#K76312. Domino Arrangements

    ID: 34615 Type: Default 1000ms 256MiB

Domino Arrangements

Domino Arrangements

You are given a non-negative integer \(n\) and your task is to generate all unique domino arrangements. A domino arrangement is represented as a pair \([a, b]\) where \(1 \le a \le b \le n\). The order of the numbers in the pair does not matter, meaning that \([a, b]\) is considered the same as \([b, a]\), so only pairs with \(a \le b\) are included.

Example:

Input: 3
Output:
1 1
1 2
1 3
2 2
2 3
3 3

Please note: When \(n = 0\), the output should be empty.

inputFormat

The input consists of a single integer \(n\) (\(n \ge 0\)) given via standard input (stdin).

outputFormat

Output all unique domino arrangements, each on a new line. For each domino, output two space-separated integers \(a\) and \(b\) (with \(a \le b\)). The pairs must be printed in increasing order first by \(a\) and then by \(b\). If \(n = 0\), output nothing.

## sample
0