atcoder#ABC251D. [ABC251D] At Most 3 (Contestant ver.)
[ABC251D] At Most 3 (Contestant ver.)
Score : points
Problem Statement
You are given an integer . You are going to prepare some weights so that all of the conditions below are satisfied.
- The number of weights is between and , inclusive.
- Each weight has a mass of positive integer not exceeding .
- Every integer between and , inclusive, is a good integer. Here, a positive integer is said to be a good integer if the following condition is satisfied:- We can choose at most 3 different weights from the prepared weights with a total mass of .
Print a combination of weights that satisfies the conditions.
Constraints
- is an integer.
Input
Input is given from Standard Input in the following format:
Output
Print in the following format, where is the number of weights and is the mass of the -th weight. If multiple solutions exist, printing any of them is accepted.
Here, and should satisfy the following conditions:
6
3
1 2 3
In the output above, weights with masses , , and are prepared. This output satisfies the conditions. Especially, regarding the -rd condition, we can confirm that every integer between and , inclusive, is a good integer.
- If we choose only the -st weight, it has a total mass of .
- If we choose only the -nd weight, it has a total mass of .
- If we choose only the -rd weight, it has a total mass of .
- If we choose the -st and the -rd weights, they have a total mass of .
- If we choose the -nd and the -rd weights, they have a total mass of .
- If we choose the -st, the -nd, and the -rd weights, they have a total mass of .
12
6
2 5 1 2 5 1
You may prepare multiple weights with the same mass.