A summer camp has boys and girls. They are split into groups so that every group has the same number of boys and the same number of girls, and everybody is in a group.
What is the largest possible number of groups?
Translate the conditions into divisibility. If there are groups with boys each and girls each, then and . So must divide both and — the group count is a common divisor, and "as many groups as possible" means the greatest common divisor.
Factor both totals into primes.
Take the smaller exponent of each shared prime. The primes common to both are and :
Confirm the split actually works. With ,
Both are whole numbers and , , so nobody is left over.
Check that or more groups is impossible. The divisors of are and the divisors of are . Their common divisors are only , so is genuinely the largest — any count above it fails to divide at least one of the two totals. As a cross-check, the Euclidean algorithm gives , , so .
Need to solve a different problem like this? Open the solver →