logo AlgoBeat OnlineJudge
登录 注册

#215623. [BalticOI 2003] Lamps (Day 2)

内存限制:512 MiB 时间限制:1000 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

There is a castle with a circular main hall. There are lamps numbered from to on the wall of the hall. Each of the lamps can be either on or off. At each second the lamp number changes its state if the lamp number is on, except the lamp number changes its state if the lamp number is on.

Your task is, given the initial states of all lamps at some moment, to find their states after seconds.

输入格式

The first line of the input contains two integers and . The next lines contain the initial states of the lamps, starting with the lamp number . A line containing means that the lamp is off and means that the lamp is on.

输出格式

The output must contain exactly lines describing the states of the lamps after seconds, starting with the lamp number .

样例

样例输入 1

3 1
0
0
1

样例输出 1

0
1
1