#P12352. 「HCOI-R2」Rabbit Panic (Easy Ver.)
「HCOI-R2」Rabbit Panic (Easy Ver.)
Description
You have a sequence where initially .
Each time you can choose distinct numbers , and simultaneously set all of into their mean. Note that the mean may not be an integer. In this case, it will never be rounded.
You need to perform at most operations to make . Note that in this version of the problem, you don't need to minimize the number of operations.
Input Format
Each test consists of multiple test cases. The first line contains a single integer --- the number of sets of test cases. The description of each test case follows.
In each test case, the only line contains two integers --- () and (), representing the length of the sequence and the number .
It's guaranteed that the sum of over all testcases does not exceed .
Output Format
For each test case, on the first line, output the number of operations you perform, . You need to guarantee that .
On the next lines, each line contains distinct integers in the range representing an operation.
If there's no solution, just print .
If there are multiple solutions, print any. Note that you don't need to minimize the number of operations.
1
6 4
2
1 2 5 6
2 3 4 5
Hint
Sample #1
- $[1,2,3,4,5,6]\to [3.5,3.5,3,4,3.5,3.5]\to [3.5,3.5,3.5,3.5,3.5,3.5]$。
- There may be different but valid solutions.
Constraints
This problem uses subtasks.
- Subtask 0 (20 pts): .
- Subtask 1 (30 pts): .
- Subtask 2 (10 pts): and .
- Subtask 3 (40 pts): No additional constraints.
It is guaranteed that , , .
京公网安备 11011102002149号