4. Nikola had to propose a flag model for his reconnaissance unit. He decided that the flag would consist of one rectangle and 7 congruent squares as shown in the diagram on the right.

![](https://cdn.mathpix.com/cropped/2024_06_05_d711adc0e32ac955c451g-2.jpg?height=182&width=336&top_left_y=570&top_left_x=1130)
Furthermore, he decided that $\frac{2}{3}$ of the flag should be painted in one color, but only whole figures should be painted. How many different flags can Nikola make?
Solution. To complete the flag to a square grid as shown in the right diagram. Then the flag contains 15 congruent squares, that is, the rectangle is divided into 8 such squares. Given

![](https://cdn.mathpix.com/cropped/2024_06_05_d711adc0e32ac955c451g-2.jpg?height=168&width=334&top_left_y=952&top_left_x=1145)
that, since $\frac{2}{3} \cdot 15=10$, according to the problem's condition, 10 such squares need to be colored. Again, due to the problem's condition, only whole figures, i.e., whole parts of the flag, can be colored. Since there are 7 small squares and a total of 10 need to be colored, if all the small squares were colored, it would leave the need to color a part of the rectangle, which is not possible. Therefore, the large rectangle must be colored. Since it contains a grid of 8 squares, 2 squares need to be chosen from the given 7. For the choice of the first square, there are 7 possibilities, and then for the choice of the second square, there are 6 possibilities. Each chosen pair of squares is counted twice, so 2 squares can be chosen in $\frac{7 \cdot 6}{2}=21$ ways. Therefore, Nikola can make 21 different flags.