Baltic Olympiad in Informatics: 2003 Day 2, Problem 2
There is a castle with a circular main hall. There are
Your task is, given the initial states of all lamps at some moment, to find their states after
Input Specification
The first line of the input contains two integers
Output Specification
The output must contain exactly
Sample Input
Copy
3 1
0
0
1
Sample Output
Copy
0
1
1
Comments