-->
当前位置:首页 > 题库

PROGRAMMING:Chessboard coverage problem

Luz5年前 (2021-05-10)题库603
Divide and conquer method is used to solve the chessboard covering problem. There is a 2K × 2K (k > 0) chessboard, just have a square different from other squares, called special square. Now we need to use the following L-shaped dominoes to cover all the squares except the special square. The dominoes can be rotated at will, and any two dominoes cannot overlap. Please give an overlay method.
![ QQ screenshot 20210225144509. PNG] (~ / 9dc79146-87b1-413b-9ccf-85c9a2ab22c2. PNG)
###Input example:
In the first line, enter a number n to indicate the size of the chessboard, and in the second line, enter the row and column subscripts of the special square.
```in
eight
1 2
```
###Output example:
Output chessboard.
```out
3 3 4 4 8 8 9 9
3 2 0 4 8 7 7 9
5 2 2 6 10 10 7 11
5 5 6 6 1 10 11 11
13 13 14 1 1 18 19 19
13 12 14 14 18 18 17 19
15 12 12 16 20 17 17 21
15 15 16 16 20 20 21 21
```






answer:If there is no answer, please comment