| 2021-2022 ICPC, Moscow Subregional |
|---|
| Finished |
In graph theory, a cactus is a connected undirected graph in which any two simple cycles have at most one vertex in common.
Given an integer $$$n$$$, build a connected graph with $$$n$$$ vertices that is not a cactus. Note that your graph can't have self-loops or multiple edges. The number of edges in your graph should be minimum possible.
The input consists of a single integer $$$n$$$ ($$$2 \le n \le 1000$$$).
If there is no connected graph of $$$n$$$ vertices without self-loops and multiple edges that is not a cactus, print -1 in the only line of the output. Otherwise, first print positive integer $$$m$$$ — the number of edges in your graph. Then print $$$m$$$ lines, each containing two integers — edges of the resulting graph. Use consecutive integers $$$1, 2, \ldots, n$$$ to enumerate the vertices of the graph.
If there are more than solutions with minimum number of edges, print any of them.
3
-1
| Name |
|---|


