orbitals are arranged in a circle and numbered through clockwise. Initially, the force intensity on every orbital is zero.
Placing a particle of strength on an orbital increases that orbital's intensity by . For every integer with , it also increases the intensities of the orbitals steps clockwise and counterclockwise by .
Thus, centered at the chosen orbital, one particle adds
The orbitals are circular, so orbital follows orbital clockwise.
The integer strength must satisfy
After choosing one value of , you may place any nonnegative number of particles of that strength. Each particle may be placed on any orbital, multiple particles may share an orbital, and all contributions accumulate.
The required final intensities are given. Find every strength for which the required intensities can be obtained exactly.
The input is given in the following format:
For each test case, let be the number of valid strengths.
If at least one valid strength exists, print on one line, where .
Each test case is given in the following format:
If no valid strength exists, print -1.
| 3 | 54 | No additional constraints. |