And not only Polly! Mirko has got many parrots (exactly P) and Polly is just one of them. (She made it to the problem statement title just because her name starts with P. 'Parrots want crackers' just doesn't sound good... it ain't got the right melody, you know...)
In recent days Mirko is trying hard to teach the parrots to repeat... like parrots. - Safko je na prd! - Safko je na prd, repeat the parrots; and they are rewarded. They get their crackers.
When distributing the crackers, Mirko tries to be as fair as possible. (The last thing he needs now is to offend one of the parrots.) Thus he used the most simple way he could think of:
At the beginning he arranges all parrots to form a circle. Then he gives a cracker to the first parrot, the second one, and all the way around to the P-th parrot. Then he continues again with the first one, the second one, ... until he runs out of crackers.
3 8 5 47Output:
2 3 1 2 2 10 3 9
Credits:
Problemsetter(s): AFAIK this was the result of some heavy brainstorming :)
Contest-related materials: Kubo, Palo