Canadian Computing Olympiad: 2017 Day 1, Problem 1
Vera loves hiking and is going to build her own trail network. It will consist of
Vera considers two places
Vera does not want her network to be too large, so the network should satisfy
Given
Input Specification
There is one line of input, which contains the integer
For 3 of the 25 available marks,
For an additional 6 of the 25 available marks,
Output Specification
Print a beautiful network in the following format:
- the first line should contain the number of vertices,
, followed by one space, followed by the number of edges, ; - each of the next
lines should contain two integers, and , separated by one space, indicating a trail between places and .
The trails can be printed in any order. The two places of any trail can be printed in any order. If there are multiple beautiful trail networks, print any of them. It is guaranteed that a solution always exists.
Sample Input 1
2
Sample Output 1
4 5
1 2
2 1
3 4
4 3
1 4
Explanation for Sample Output 1
The two beautifully connected pairs are 1, 2 and 3, 4.
Sample Input 2
6
Sample Output 2
4 4
1 2
2 3
3 4
4 1
Explanation for Sample Output 2
All pairs of places form a beautifully connected pair.
Comments
ah didnt see that the network had to be connected