3.1. From a square grid with a side of 40, a rectangle $36 \times 37$ was cut out, adjacent to one of the corners of the square. Grisha wants to color a five-cell cross in the remaining piece. In how many ways can he do this?

![](https://cdn.mathpix.com/cropped/2024_05_06_5d23a8290d62259f41d0g-1.jpg?height=314&width=322&top_left_y=1048&top_left_x=176)
Answer: 113

Solution 1. If the rectangle had not been cut out, the number of ways to color the cross would be $38 \times 38=1444$ (the cross is determined by its central cell, which cannot be adjacent to the edge). Due to the cut-out, $36 \times 37-1$ ways are lost (the center of the cross cannot be in the cut-out rectangle or adjacent to its side, but it can share a vertex with a vertex of the cut-out rectangle). From this, we get the answer.

Solution 2. Suppose the four first columns and three first rows remain uncut. Then the center of the cross can be placed in the second or third column (but not in the first or last row), or in the second row (excluding the first three columns and the last one), and also at the intersection of the third row and the third column.

![](https://cdn.mathpix.com/cropped/2024_05_06_5d23a8290d62259f41d0g-1.jpg?height=449&width=500&top_left_y=1917&top_left_x=161)