Editorial for WC '17 Contest 2 J2 - Breeding an Army


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.

Saruman can create no more than M_s/M_u Uruk-hai (rounded down to the nearest integer) before running out of men. Similarly, he can create no more than O_s/O_u Uruk-hai due to orc restrictions, and no more than L_s/L_u Uruk-hai due to mud restrictions. Putting these facts together, the maximum number of Uruk-hai he can create is the minimum of the three floored quotients M_s/M_u, O_s/O_u, and L_s/L_u.


Comments

There are no comments at the moment.