Problem 3. In a school, 180 boys and 192 girls are enrolled. From them, parallel classes are formed with an equal number of students, so that the number of boys in each of the parallel classes is the same. In the classrooms where the lessons take place, there are no more than 40 chairs. How many boys and girls are there in each of the parallel classes?
Solution. Let $x$ be the number of parallel classes. Since, in each of the parallel classes, there is an equal number of boys and all parallel classes have an equal number of students, it follows that in each of the parallel classes, there is also an equal number of girls. The number of boys in each of the parallel classes is $m=180: x$, and the number of girls in each of the parallel classes is $d=192: x$. Therefore, $x$ is a divisor of both 180 and 192. From the factorizations $180=2 \cdot 2 \cdot 5 \cdot 3 \cdot 3$ and $192=2 \cdot 2 \cdot 2 \cdot 2 \cdot 2 \cdot 2 \cdot 3$, we have that $x \in\{1,2,4,6,12\}$. Note that we need $m+d \leq 40$, from which we conclude that both $m \leq 40$ and $d \leq 40$. Therefore, $x \geq 5$ (specifically, if $x<5$, then either $m>40$ or $d>40$). If $x=12$, then $m=180: 12=15, d=192: 12=16$ and $m+d=31 \leq 40$. Therefore, in each of the parallel classes, there are 15 boys and 16 girls.