5. A few years ago, in the computer game "Minecraft," there were 11 different pictures (see the figure): one horizontal with dimensions $2 \times 1$, and two each with dimensions $1 \times 1$, $1 \times 2$ (vertical), $2 \times 2$, $4 \times 3$ (horizontal), and $4 \times 4$. In how many ways can all 11 pictures be placed on a rectangular wall that is 12 blocks long and 6 blocks high? The pictures should not overlap; they cannot be rotated.

![](https://cdn.mathpix.com/cropped/2024_05_06_878546d275f98f4c16cbg-2.jpg?height=308&width=534&top_left_y=1185&top_left_x=1372)

(P. D. Mulyenko)
Answer: 16896.

Solution. We will say that two pictures are in different columns if no block of the first picture is in the same column as any block of the second. It is clear that the $4 \times 4$ pictures are in different columns from each other and from the $4 \times 3$ pictures in any arrangement. Thus, the $4 \times 3$ pictures will necessarily be strictly one below the other. Both $4 \times 4$ pictures are pressed against the floor or ceiling, as at least 6 columns must have 2 free adjacent cells for the remaining pictures of height 2. There are $3 \cdot 2^{4}=48$ ways to place the 4-wide pictures (3 ways to choose the column with the $3 \times 3$ picture, $2^{2}$ ways to choose "floor/ceiling" in the other columns, 2 ways to permute the $4 \times 4$ pictures, and another 2 ways to permute the $4 \times 3$ pictures). Out of these, in 16 cases, a $8 \times 2$ empty area remains (there are 4 "degrees of freedom" with 2 options each, as shown by the colored arrows in the middle picture). In the remaining 32 cases, two separate $4 \times 2$ areas remain.

Note that in any case, the $1 \times 1$ pictures together with the $2 \times 1$ picture will form a $2 \times 2$ square, so they can be replaced by one glued picture (and the answer for the new set of pictures should be multiplied by 4 ways to unglue it).

If an $8 \times 2$ area remains, it needs to be filled with five vertical blocks in some order, for which there are $5!=120$ ways.

![](https://cdn.mathpix.com/cropped/2024_05_06_878546d275f98f4c16cbg-3.jpg?height=643&width=1602&top_left_y=107&top_left_x=181)

Consider the case where two $4 \times 2$ free areas remain. Then one area must be divided into two $2 \times 2$ pictures, and the other into one $2 \times 2$ picture and two $1 \times 2$ pictures. There are two ways to choose which area gets which, then 3 ways to choose which $2 \times 2$ picture (including the composite one) will be on the second area; after that, $2!$ ways to order the blocks for the first area and $3!$ for the second. In total, $2 \cdot 3 \cdot 6 \cdot 2=72$ ways.

In total, $4 \cdot(32 \cdot 72+16 \cdot 120)=16896$ variants.

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

It is obtained that the 4-wide pictures can be arranged in 48 ways - another 2 points (with an error in the calculation, ±1 point).

It is obtained that in the case of two "windows" $4 \times 2$, there are 72 ways to arrange the small pictures - another 2 points (with an error in the calculation, ±1 point).

It is obtained that in the case of a single $8 \times 2$ space, there are 120 ways to arrange the small pictures - another 2 points (with an error in the calculation, ±1 point).