4. A square with side 5 is divided into 25 unit squares, and each of them is colored with one of two colors. Prove that there exist four same-colored unit squares whose centers are vertices of a rectangle with sides parallel to the sides of the square. Prove that the statement does not hold for a square with side 4.
Problem 1168
Official solution
Solution. Let's denote the rows of the given table as , and the columns as , similar to the conventional notation of a chessboard (diagrams a), b), and c)). Let the colors mentioned in the problem be blue (the blue squares are the penalized ones) and red. In the first row, at least three squares are of the same color, and for definiteness, let's assume that these are the squares which are blue. If in any row from 2 to 5 in the first three columns there are two blue squares (for example, as in diagram a), squares and ), then the desired rectangle is determined.
!
a)
!
b)
!
c)
Therefore, let's assume that in each of the following four triplets
at least two squares are red. If in one of these triplets all squares are red (as in diagram b), this is the triplet ()), then a monochromatic rectangle is easily determined. If in each of these four triplets there are exactly two red squares, then there are three possible arrangements of the red squares, and by the pigeonhole principle, at least in two of them the squares are
!
arranged in the same way, which again gives the desired rectangle. In diagram c), this is the rectangle .
That the statement does not hold for a square with side 4 is shown by the diagram on the right.
## II year