I took a classic black and white chessboard, which was made up of $8 \times 8$ square tiles with sides of $3 \mathrm{~cm}$. I rearranged the tiles within the given frame so that one black rectangle, one black square, and one contiguous white shape were formed. The individual tiles still touched each other with their entire sides after rearrangement. The black shapes did not touch (not even at a corner), and each of them had at least one side in common with the edge of the chessboard.

Determine the maximum possible perimeter of the white shape and draw how it might look in such a case.

(M. Mach)

Hint. What dimensions could the square have?
A chessboard has a total of 32 black (and 32 white) squares, which must be the sum of the newly formed black shapes. Therefore, a black square can have a maximum size of $5 \times 5$ squares. We will examine all possible cases according to the size of the black square, determine how many squares remain for the black rectangle and what its dimensions could be, and finally decide whether it is possible to place such shapes according to the given requirements:

| square | remaining for rectangle | can be placed |
| :---: | :---: | :---: |
| $1 \times 1$ | $1 \times 31$ | $\mathrm{NO}$ |
| $2 \times 2$ | $1 \times 28$ | $\mathrm{NO}$ |
| $2 \times 2$ | $2 \times 14$ | $\mathrm{NO}$ |
| $2 \times 2$ | $4 \times 7$ | $\mathrm{YES}$ |
| $3 \times 3$ | $1 \times 23$ | $\mathrm{NO}$ |
| $4 \times 4$ | $1 \times 16$ | $\mathrm{NO}$ |
| $4 \times 4$ | $2 \times 8$ | $\mathrm{YES}$ |
| $5 \times 5$ | $1 \times 7$ | $\mathrm{YES}$ |

All cases that cannot be satisfactorily placed exceed the given frame of the chessboard in some dimension. In the acceptable cases, it is possible to place the black shapes, for example, as follows:
![](https://cdn.mathpix.com/cropped/2024_04_17_f3fae1a08c67cff3918eg-2.jpg?height=408&width=1446&top_left_y=1238&top_left_x=312)

For each case, the placement of at least one of the black shapes can be modified without violating any of the requirements. Such changes either keep the perimeter of the white shape the same or reduce it (if one of the black shapes is moved to a corner of the chessboard).

The perimeter of the white shape in the above cases consists of 50, 36, and 56 sides of the squares, respectively. The largest is in the third case and is $56 \cdot 3=168(\mathrm{~cm})$.