#K64527. Activity Schedule Generation
Activity Schedule Generation
Activity Schedule Generation
You are given a number ( n ) (( 2 \le n \le 100 )) representing the number of activities labeled from 1 to ( n ). Your task is to generate a schedule such that each guest participates in two consecutive activities without repetition. In particular, the schedule consists of pairs ( (i, i+1) ) for ( 1 \le i < n ) and a final pair ( (n, 1) ) that loops back to the beginning.
For example, if ( n = 3 ), the schedule should be: [(1, 2), (2, 3), (3, 1)]
.
inputFormat
The input is read from stdin and consists of a single integer ( n ) (( 2 \le n \le 100 )) which denotes the number of activities.
outputFormat
The output should be printed to stdout as a list of tuples. Each tuple represents a pair of consecutive activities in the format: (a, b)
. The entire schedule is enclosed in square brackets, with each tuple separated by a comma and a space.## sample
3
[(1, 2), (2, 3), (3, 1)]