atcoder#ARC122C. [ARC122C] Calculator
[ARC122C] Calculator
Score : points
Problem Statement
Snuke has integers and . Initially, .
Snuke can do the following four operations any number of times in any order:
- Operation : Replace the value of with .
- Operation : Replace the value of with .
- Operation : Replace the value of with .
- Operation : Replace the value of with .
You are given a positive integer . Do at most operations so that will have the value . Here, can have any value. We can prove that such a sequence of operations exists under the constraints of this problem.
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print your answer in the following format:
Here, denotes the number of operations, and represents the -th operation to be done.
4
5
1
4
2
3
1
Here, the values of and change as follows: (Operation ) (Operation ) (Operation ) (Operation ) (Operation ) , and the final value of matches .