#C6203. Secret Santa Gift Exchange
Secret Santa Gift Exchange
Secret Santa Gift Exchange
You are organizing a Secret Santa gift exchange among n friends. Each friend will give a gift to exactly one other friend, and the assignment should form a simple cyclic order. In other words, for each friend i (where i=1,2,...,n), they will give a gift to friend (i \mod n)+1.
Your task is to generate this assignment. The program should read a single integer n from the standard input which represents the number of friends. Then, it should output exactly n lines, where each line contains two space-separated integers representing the giver and the receiver respectively.
For example, if n = 3, the assignments are:
[ 1 \to 2, \quad 2 \to 3, \quad 3 \to 1 ]
Ensure your solution handles the case where n = 1 as well.
inputFormat
The input consists of a single integer n (1 \leq n \leq 10^5), representing the number of friends participating in the Secret Santa exchange.
outputFormat
Output n lines. On the ith line, print two integers: the giver's number and the receiver's number, separated by a single space. The assignment is defined such that for every i (where 1 \leq i \leq n), the receiver is (i \mod n) + 1.
## sample3
1 2
2 3
3 1
</p>