创建于 2026/07/17 · 更新于 2026/07/17
You have cards, each labeled with an integer from to . For every with , there are cards labeled .
Choose an integer with and add one additional card labeled . Your goal is to make the following condition true.
Condition: You can repeat the operation below exactly times and remove all cards.
List all values of for which the condition can be satisfied.
The first line contains two integers and (, ).
The second line contains integers (, ).
On the first line, output , the number of values of that satisfy the condition.
On the second line, output all such values of in increasing order.
5 4
0 4 2 2 3
2
2 5
4 1
1 0 0 1
0
8 15
7 10 4 2 8 6 3 4
3
1 4 7