Problem 9.5. Leonid has a white checkered rectangle. First, he painted every other column gray, starting with the leftmost one, and then every other row, starting with the topmost one. All cells adjacent to the border of the rectangle ended up being painted.

How many painted cells could there be in the rectangle if 74 white cells remained? List all possible options.

An example of coloring a $5 \times 7$ rectangle is shown below.

![](https://cdn.mathpix.com/cropped/2024_05_06_3890a5f9667fd1ab5160g-32.jpg?height=226&width=311&top_left_y=448&top_left_x=575)
Answer: 301 or 373.

Solution. From the condition, it follows that the rectangle has an odd number of both rows and columns. Let's number the rows from top to bottom with the numbers $1,2, \ldots, 2 k+1$, and the columns from left to right with the numbers $1,2, \ldots, 2 l+1$ (for non-negative integers $k$ and $l$). Without loss of generality, $k \leqslant l$.

Notice that all white cells are located exactly in those cells where both the column and row numbers are even. From this, it follows that $74=k \cdot l$. Then either $k=1$ and $l=74$, or $k=2$ and $l=37$. Clearly, the total number of shaded cells is $(2 k+1)(2 l+1)-k l$, so in the first case, we get the answer $3 \cdot 149-1 \cdot 74=373$, and in the second case, the answer is $5 \cdot 75-2 \cdot 37=301$.