eolymp
bolt
Try our new interface for solving problems
Problems

Open air

Open air

\includegraphics{https://static.e-olymp.com/content/58/58c6dec5efacba363a8daa432660d1b6777b0bd1.jpg} You are given a full set of dominoes with two numbers from \textbf{0} to \textbf{N} (\textbf{N} --- is even) written on each. There is only one exemplar of each pair of numbers \{\textbf{a}, \textbf{b}\} It's easy to count that amount of dominoes is . Place all dominoes horizontally in \textbf{N+1} row so, that sums of numbers on dominoes in each row are equal. Guaranteed, that it's always possible. \InputFile Even number \textbf{N} in the only line. \OutputFile \includegraphics{https://static.e-olymp.com/content/97/9741297a26926b982b63c4937f7974ddc7ab3879.jpg} Output \textbf{N+1} line with \textbf{N+2} numbers in each: \textbf{a_1}, \textbf{b_1}, \textbf{a_2}, \textbf{b_2}, ..., \textbf{a_k}, \textbf{b_k}, \textbf{k =} , where each pair \textbf{a_i}, \textbf{b_\{i \}}corresponds to a domino. Use each domino only once. Pair of numbers on each domino can be written in any order. If there are multiple solutions, you may output any one. \textbf{Limits} \textbf{2} ≤ \textbf{N} ≤ \textbf{100}, \textbf{N} is even.
Time limit 2 seconds
Memory limit 256 MiB
Input example #1
2
Output example #1
0 2 1 1
0 1 1 2
0 0 2 2