Editorial for WC '18 Contest 3 J1 - An Honest Day's Work


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.

With P litres of paint and each badge requiring B litres of it, James will produce PB badges. There will be PPB×B litres of paint left over, which is equivalent to PmodB (the remainder when P is divided by B, written as the % operator in most programming languages). Therefore, the number of Pokédollars made will be PB×D+(PmodB).


Comments

There are no comments at the moment.