SP8578 REVSEQ - Reverse the Sequence
Description
This is a very ad-hoc problem. Consider a sequence (N, N-1, ..., 2, 1). You have to reverse it, that is, make it become (1, 2, ..., N-1, N). And how do you do this? By making operations of the following kind.
Writing three natural numbers A, B, C such that 1
This means that you can pick any two adjacent blocks (each of an arbitrary length) and swap them. The problem can easily be solved in N-1 operations, but to make it more difficult, you must think of a faster way.
Input Format
A natural number 1 < N < 100.
Output Format
Output at most 50 operations, one per line. Each opearations is represented by three numbers as described above.