Problem Author: | Kostiantyn Lutsenko |
Prepared by: | Kostiantyn Lutsenko |
Matvii Strechen | |
Pavlo Tsikalyshyn | |
Editorial by: | Kostiantyn Lutsenko |
10pt
Block 0
If there is at least one «4», then all adjacent to it are also «4», and those adjacent to the neighboring «4» are also «4», and so on. But the table is finite, so this is impossible.
If there is at least one «3», consider the highest among them. Then in all directions except upwards, it borders with other «3». Consider the «3» to the right of the initial one. Similarly, it is bordered on the left, bottom, and right by other «3». This can be extended infinitely to the right, which contradicts the table's finiteness.
The twos form cyclical structures. Ones are positioned like dominoes. Zeros are isolated from other zeros. This is clearly seen from the problem statement example.
The above mentioned thoughts are not mandatory, but such analysis helps in solving the problem.
Block 1 (n = 1)
It is not difficult to notice that alternating dominoes «1-1» and isolated «0», one can create a chain of any length.
Block 2 (n = 2)
Duplicating the solution from Block 1 and increasing all numbers by 1, it will work for this block.
Block 2 (n = 3)
If we frame it with «2», then the 1 \times (m-2) strip remains, for which the solution for Block 1 can be applied.
Block 3
Take the example from the problem statement. Cut off the leftmost and rightmost columns. Change the corners from «1» to «0».
Blocks 5-11
If you place two dominoes with «1» and an isolated «0» next to a «2» square, you get a 3 \times 3 pattern that can be repeated infinitely.
Moreover, considering a specific row, it's always the same situation as in Block 1: two identical digits, one different, two identical, one different... This means that, as in Block 1, we can choose a segment of columns so that there are no problems at the borders. Similarly, we can choose a segment of rows so that there are no problems at the borders. The answer is a table formed by the intersection of these rows and columns.
Block 8