Evvoconiov M.A.

An abstract artist took a wooden cube 5×5×5, divided each face into unit squares, and painted each of them in one of three colors - black, white, or red - so that there are no adjacent squares of the same color. What is the minimum number of black squares that could result? (Squares that share a side are considered adjacent, even if they lie on different faces of the cube.)
Evaluation. Three squares at the vertex of a cube form a cycle of adjacent squares of length 3. Around it, another cycle of length 9 is formed from adjacent cells. And around that, a cycle of length 15. Taking three such cycles around two opposite vertices of the cube, and two small cycles around the remaining vertices, we get 18 non-intersecting odd cycles. Since an odd cycle cannot be properly colored with two colors, each of them contains a black cell.

Example. Let's color the four side faces in red and white in a checkerboard pattern. The top and bottom faces will be colored as shown in the figure.

![](https://cdn.mathpix.com/cropped/2024_05_06_5e05e09159d75892ee01g-18.jpg?height=446&width=440&top_left_y=2252&top_left_x=818)

## Answer

18 squares.

## Problem