eolymp
bolt
Спробуйте наш новий інтерфейс для відправки розв'язків
Задачі

Horrible Truth

Horrible Truth

In a Famous TV Show "Find Out" there are \textbf{n} characters and only one Horrible Truth. To make the series breathtaking all way long, the screenplay writer decided that every episode should show exactly one important event. There are three types of the \textit{important events} in this series: \begin{itemize} \item character \textbf{A} finds out the Truth; \item character \textbf{A} finds out that the other character \textbf{B} knows the Truth; \item character \textbf{A} finds out that the other character \textbf{B} doesn't know the Truth. \end{itemize} Initially, nobody knows the Truth. All events must be correct, and every fact found out must be true. If some character finds out some fact, she cannot find it out once again. Moreover, to give the audience some sense of action, the writer does not want an episode to show the important event of the same type as in the previous episode. Your task is to determine the maximal possible number of episodes in the series and to create an example of a screenplay plan. \InputFile The only line of the input contains a single integer \textbf{n} - the number of characters in the TV show (\textbf{1} ≤ \textbf{n} ≤ \textbf{100}). \OutputFile In the first line of the output file output a single integer \textbf{k} - the maximal possible number of episodes in the series. Then write \textbf{k} lines, each containing a description of an episode. For the episode in which character \textbf{A} (characters are numbered \textbf{1} through \textbf{n}) finds out the Truth, write the line "\textbf{A 0}". For an episode in which character \textbf{A} finds out that character \textbf{B} knows the Truth, write the line "\textbf{A B}". Similarly, for an episode in which character \textbf{A} finds out that character \textbf{B} doesn't know the Truth, write the line "\textbf{A} \textbf{-B}". If there are several plans providing the maximal possible number of episodes, output any one of them.
Ліміт часу 3 секунди
Ліміт використання пам'яті 256 MiB
Вхідні дані #1
3
Вихідні дані #1
13
2 -1
1 0
1 -2
2 1
3 -2
3 1
2 0
1 -3
1 2
2 -3
3 2
3 0
1 3
Автор Dmitry Gozman, Yury Petrov