Editorial for DMOPC '15 Contest 3 P2 - Cheesecake Distribution
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.
Author:
Knowledge required: array processing, basic math
This was slightly trickier than the usual P2. Notice that we're only concerned with the final state, not the steps we take to get there.
Let's denote Impossible
.
If it is divisible, we know that each person has to have
Time Complexity:
Comments