Task
You are given a positive integer . Construct a sequence that has exactly subarrays, not necessarily disjoint, each admitting a majority element.
An element is considered a majority in a sequence of numbers if it appears at least times.
The elements of the sequence must be positive integers between and the length of the sequence (inclusive).
Any sequence whose length belongs to the interval , where and are specified in the problem constraints, is considered correct and will be scored accordingly.
You need to solve the problem for scenarios.
Input data
The first line of the input file contains the number .
The next lines each contain a positive integer , as described in the statement.
Output data
The output file will contain the solution for each of the scenarios. For each scenario, two lines will be displayed in the following format:
The first line will contain the length of the found sequence. The second line will contain the elements of the sequence, separated by a space.
Constraints and clarifications
- .
- For sequences with a length less than or equal to , the maximum score will be awarded.
- For sequences with lengths in the interval , between and percent of the score will be awarded according to the formula .
- For sequences longer than , zero points will be awarded.
- In a test case, the final score is the minimum obtained across all scenarios.
- It is guaranteed that a solution always exists that satisfies the problem constraints.
# | Score | Restrictions |
---|---|---|
1 | 30 | , , . |
2 | 30 | , , |
3 | 40 | , , |
Example 1
stdin
1
2
stdout
2
0 1
Explanation
For the first example, for the sequence {}, the subsequences are: {} and {}.
Example 2
stdin
2
5
2
stdout
3
1 0 0
2
1 2
Explanation
For the second example, for the sequence , the subsequences are: , , , , and . For the sequence , the subsequences are: and .