IOI '14 - Taipei, Taiwan
Place tiles on the floor
We have a by floor with unit squares. Each square can be identified by its and coordinates (both from to ). We want to cover this floor with four types of by L-shaped tiles, as shown in the following figure. The tiles cannot overlap, and they can only be placed on the grid boundary. In addition, there is exactly a square that we cannot cover with tiles. Please find a way to cover the entire floor with tiles.
Example
In the following example we have and squares. The blue square at cannot be covered by any tile. This figure shows a possible way to cover the floor. To identify a tile we will use the and coordinates. For example, the green tile in the figure can be identified by , , and .
Statement
Write a program to cover the floor with tiles.
Input Specification
The input consists of one line with integers , , and . indicates that the size of the floor is by . and are the coordinates of the square that cannot be covered with tiles.
Output Specification
The output should consist of a list of tile positions. Each line of the output should contain six space-separated integers , , , , , and to describe the position of one tile. For example, if we want to place the green tile as the first tile, we can output the integers , , , , , and . The three squares of a tile can appear in any order, so we can also set them as , , , , , and . The tiles can also appear in any order.
Sample Input 1
1 0 0
Sample Output 1
0 1 1 0 1 1
Sample Input 2
1 1 0
Sample Output 2
0 0 0 1 1 1
Constraints
Subtask 1 [5%]
Subtask 2 [15%]
Subtask 3 [20%]
Subtask 4 [60%]
Comments