Problem E
Orthogonal Rotation
You are given two vectors
We can do this again and again to get new versions of
Note that to check whether
For what number of rotations do the vectors fit together?
Input
The first line of input contains an integer
Output
Print all numbers of rotations that make the vectors fit
together, that is to say if moving the last value to the front
Sample Input 1 | Sample Output 1 |
---|---|
4 1 0 -1 0 0 -1 0 1 |
0 2 |
Sample Input 2 | Sample Output 2 |
---|---|
5 1 2 3 4 5 -3 -2 -1 -5 -4 |
-1 |
Sample Input 3 | Sample Output 3 |
---|---|
3 0 0 0 0 0 0 |
0 1 2 |