5. A few years ago, in the computer game "Minecraft," there were 9 different pictures (see the figure): one horizontal picture measuring $2 \times 1$ and $4 \times 2$, one square picture measuring $2 \times 2$, and two each of pictures measuring $1 \times 1$, $4 \times 3$ (horizontal), and $4 \times 4$. In how many ways can all 9 pictures be placed on a rectangular wall measuring 12 blocks in length and 6 in height? The pictures should not overlap; they cannot be rotated.

![](https://cdn.mathpix.com/cropped/2024_05_06_758bf2042e6fda9db2ecg-2.jpg?height=285&width=551&top_left_y=1091&top_left_x=1366)
Answer: 896.

Solution. We will say that two paintings are in different columns if no block of the first painting is in the same column as any block of the second. It is clear that the $4 \times 4$ paintings are in different columns from each other and from the $4 \times 3$ paintings regardless of their placement. Thus, the $4 \times 3$ paintings will necessarily be strictly one below the other. The $4 \times 4$ paintings will be pressed against the floor or ceiling, as there must still be $4 \times 2$ and $2 \times 2$ paintings on the wall.

Consider the case where the $4 \times 2$ is strictly above or below one of the $4 \times 4$ paintings. It is clear that there are $3 \cdot 2^{2} \cdot 2^{3}=96$ ways to place all the paintings of width 4 (if we consider the small paintings as one $4 \times 2$ painting, we get 3 ways

| $4 \times 3$ | $4 \times 2$ |  |
| :---: | :---: | :---: |
|  |  |  |
| $4 \times 3$ | $4 \times 4$ | $4 \times 4$ |

to choose the column for the $4 \times 3$ paintings, $2^{2}$ ways to choose the attachment to the floor/ceiling in each of the other columns, and $2^{3}$ ways to swap paintings of the same size). The remaining paintings can be placed in $2^{3}=8$ ways in the remaining $4 \times 2$ wall space, as the $2 \times 2$ and $2 \times 1$ paintings must be in different columns.

Now let the $4 \times 2$ painting be above or below both $4 \times 4$ paintings. Since it and the $2 \times 2$ and $2 \times 1$ paintings must be in different columns, there are 16 ways to place all the paintings of width 4 (2 ways to choose the column for the $4 \times 3$, 2

| $4 \times 2$ |  |  | $4 \times 3$ |
| :---: | :---: | :---: | :---: | :---: |
| $4 \times 4$ | $4 \times 4$ | $4 \times 3$ |  |

ways to choose "ceiling/floor" and $2^{2}=4$ ways to swap paintings of the same size). The remaining two $2 \times 2$ areas can be filled in 8 ways.

In total, $8 \cdot(96+16)=896$ options.

Criteria. It is shown that the three smallest paintings (two $1 \times 1$ and one $1 \times 2$) can only be placed together as a $2 \times 2$ square - 1 point.

Correct reasoning about the placement of the $4 \times 4$ and $4 \times 3$ paintings - another 2 points.

Any significant error in calculating the ways to place the paintings of width 4 (for example: not considering that the number of options in cases where the $4 \times 2$ painting is strictly below or above a $4 \times 4$ painting or below or above two of them, are different; or not considering that in cases where the $4 \times 4$ paintings are in adjacent columns, the number of remaining cases is different depending on their position (both above, both below, or one above and one below)) -2 points. Arithmetic error in counting cases - - -1 point.