Answer: 21.

First solution. Let the rectangle occupy $a$ cells vertically and $b$ horizontally, $a+b=50: 2=25$. Similarly, let the dimensions of the hole be $x$ cells vertically and $y$ horizontally, $x+y=32: 2=16$.

![](https://cdn.mathpix.com/cropped/2024_05_06_9c536c324e1528721567g-3.jpg?height=345&width=442&top_left_y=1002&top_left_x=510)

If there were no hole, there would be $a$ horizontal strips. The hole cuts $x$ of them into two parts, so the total number of horizontal strips is $a+x$, which is 20 according to the problem. Similarly, the number of vertical strips will be $b+y$. But $a+b+x+y=25+16=41$ and $a+x=20$. Therefore, $b+y=41-20=21$.

Second solution. For each horizontal strip, mark its left and right sides, and for each vertical strip, mark its top and bottom. Clearly, we have marked all the boundaries of the cells on the contour of the rectangle and the contour of the hole, i.e., $50+32=82$ boundaries. Each strip gave us two boundaries, so the total number of strips is $82: 2=41$. There are 20 horizontal strips, so there are 21 vertical strips.

Comment. The second solution is more general - it works even in the case where the figure and the hole have a complex polygonal shape (see figure).

![](https://cdn.mathpix.com/cropped/2024_05_06_9c536c324e1528721567g-4.jpg?height=359&width=420&top_left_y=404&top_left_x=517)
Problem 4. Inside a rectangular grid with a perimeter of 50 cells, a rectangular hole with a perimeter of 32 cells is cut out along the cell boundaries (the hole does not contain any boundary cells). If the figure is cut along all horizontal grid lines, 20 strips 1 cell wide will be obtained. How many strips will be obtained if, instead, it is cut along all vertical grid lines? (A $1 \times 1$ square is also a strip!)

[6 points]

(A. V. Shapovalov)