4. (13 points) In a dance ensemble, there are 8 boys and 16 girls. Some of them form mixed (boy and girl) dance pairs. It is known that in each pair, at least one of the partners does not belong to any other pair. What is the maximum number of dance pairs that can be formed in this ensemble?
Answer: 22.

Solution. Example. Let Yana and Maxim be the best dancers in the ensemble. If Maxim dances with all the girls except Yana, and Yana dances with all the boys except Maxim, then the condition of the problem is satisfied and the number of pairs will be $15+7=22$.

Estimate. Let's call a pair in which the partner does not participate in other pairs - male, and a pair in which the partner does not participate in other pairs - female. (A pair can be both male and female). If there are 8 male pairs, then there are no other pairs. Therefore, if we want the total number of pairs to be more than 8, the number of male pairs should not exceed 7. If there are 16 female pairs, then there are also no other pairs. And if we want the total number of pairs to be more than 16, the number of female pairs should not exceed 15. Thus, the total number of pairs (each of which is either male or female) is no more than $7+15=22$.

Grading criteria. Full solution - 13 points. Only the example is worth 6 points; only the estimate - 7 points.