N robbers and m monkeys are stuck on an island. The robbers have collected a pile of bananas. They decided to divide the bananas equally among themselves. They don't trust each other. One robber wakes up in the night and divides the bananas into n equal parts with m leftovers which he gives to m monkeys. Then he hides his own share. One by one remaining robbers does the same.
コメント