#P1911. L 国的战斗之排兵布阵
L 国的战斗之排兵布阵
Description
You are given a grid and "L"-shaped trominoes of size , numbered from to (shape shown below):
*.
**
Construct a placement so that every cell is covered by some tromino except the cell at row (from top to bottom) and column (from left to right). Trominoes may be rotated.
Input Format
One line with three integers .
Output Format
Output lines, each with integers. The number at the -th row and -th column indicates the index of the tromino covering that cell. Specifically, for the cell at row and column , output .
There may be multiple valid answers; output any one of them.
4 1 3
1 1 0 2 3 3 4 4 5 5 6 6 7 7 8 8
1 9 2 2 3 10 10 4 5 11 11 6 7 12 12 8
13 9 9 14 15 15 10 16 17 11 18 18 19 19 12 20
13 13 14 14 21 15 16 16 17 17 18 22 22 19 20 20
23 23 24 21 21 25 26 26 27 27 28 28 22 29 30 30
23 31 24 24 25 25 32 26 27 33 33 28 29 29 34 30
35 31 31 36 37 32 32 38 39 39 33 40 41 34 34 42
35 35 36 36 37 37 38 38 43 39 40 40 41 41 42 42
44 44 45 45 46 46 47 43 43 48 49 49 50 50 51 51
44 52 52 45 46 53 47 47 48 48 54 49 50 55 55 51
56 52 57 57 58 53 53 59 60 54 54 61 62 62 55 63
56 56 57 64 58 58 59 59 60 60 61 61 65 62 63 63
66 66 67 64 64 68 69 69 70 70 71 65 65 72 73 73
66 74 67 67 68 68 75 69 70 76 71 71 72 72 77 73
78 74 74 79 80 75 75 81 82 76 76 83 84 77 77 85
78 78 79 79 80 80 81 81 82 82 83 83 84 84 85 85
Hint
Constraints: , .
Translated by ChatGPT 5
京公网安备 11011102002149号