Editorial for COCI '08 Contest 5 #2 Jabuka
Remember to use this editorial only when stuck, and not to copy-paste code from it. Please be respectful to the problem author and editorialist.
Submitting an official solution before solving the problem yourself is a bannable offence.
Submitting an official solution before solving the problem yourself is a bannable offence.
We must find numbers of children which divide both and . Each of these numbers is a possible solution – we can divide the fruit among children so that each child gets red apples and green apples. To do this, we find all divisors of (there are at most of them) and for each of them check if it also divides .
Comments