| Winter Cup 8.0 Online Mirror Contest |
|---|
| Закончено |
Rami and Khalil are fierce competitors in two-player games. This time, they agreed to play the following turn-based game, designed by Khalil.
The game starts with a list of $$$n$$$ positive integers $$$A = [A_1, A_2, \dots, A_n]$$$.
On each turn, the current player selects one number $$$A_i$$$ from the list and replaces it with either:
The player who cannot make a move on their turn loses. Khalil will be the starting player.
While Khalil was carefully considering his first move, Rami realised something interesting: he can sneakily add some positive integers to the list before the game starts to guarantee his win (as the second player).
Since Rami wants to avoid suspicion, he needs to minimize the number of integers he adds. If multiple minimal solutions exist, any valid set will work.
Help Rami determine the smallest set of positive integers (possibly empty) that he can add to the list so that he will win assuming both players play optimally.
It is guaranteed that the sum of $$$n$$$ over all test cases doesn't exceed $$$10^6.$$$ Formally: $$$\sum_{i}n_i \le 10^6$$$
For each test case, output a line containing:
2 2 9 27 5 2 3 6 5 7
1 3 1 35
After Rami adds these integers, the game proceeds with Khalil making the first move on the modified list $$$A'=\mathrm{concat}(A,B)=[A_1,\dots,A_n, B_1,\dots,B_m]$$$
| Название |
|---|


