atcoder#RELAYJ. 連結チェスボード
連結チェスボード
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.
2
1
1 0
4
3
0 1
2 1
2 3