

Time Limit: 2 sec / Memory Limit: 256 MB
配点 : 点
問題文
マス × マスのチェスボードがあります。
最も左上のマスから、右に マス、下に マス進んだマスを と呼びます。特に、最も左上のマスは です。
が偶数であるようなマス は黒、それ以外のマスは白で塗られています。
これから、いくつかの白いマスを黒に塗り替えることで以下の条件が満たされるようにします。
- マス から始めて、辺を共有する黒いマスに移動するという操作を繰り返したときに、全ての黒いマスにたどり着くことができる。
個以下のマスを黒く塗り替えることで条件を達成してください。
制約
入力
入力は以下の形式で標準入力から与えられる。
出力
条件を達成するために黒く塗り替えたマスの情報を以下の形式で出力せよ。
これは、全部で 個のマスを黒く塗り替えており、 番目に のマスを黒く塗り替えたことを表す。
判定
以下の全ての条件を満たしているときのみ、その出力は正解とみなされる。
- 全ての に対して は奇数。
- ならば
- 出力された全てのマスを黒く塗ることで問題文中の条件が達成されている。
入力例 1Copy
2
出力例 1Copy
1 1 0
入力例 2Copy
4
出力例 2Copy
3 0 1 2 1 2 3
Score : points
Problem Statement
We have an checkerboard.
From the square at the upper left corner, a square that is squares to the right and squares below is denoted as . Particularly, the square at the upper left corner is denoted as .
Each square such that is even, is colored black, and the other squares are colored white.
We will satisfy the following condition by painting some of the white squares:
- Any black square can be reached from square by repeatedly moving to a black square that shares a side with the current square.
Achieve the objective by painting at most squares black.
Constraints
Input
The input is given from Standard Input in the following format:
Output
Print the squares to paint in the following format:
:
This means that a total of squares are painted black, the -th of which is .
Judging
The output is considered correct only if all of the following conditions are satisfied:
- For each , is odd.
- If , then .
- The condition in the statement is satisfied by painting all specified squares.
Sample Input 1Copy
2
Sample Output 1Copy
1 1 0
Sample Input 2Copy
4
Sample Output 2Copy
3 0 1 2 1 2 3