Rosetta Problems

Distributing the Treasure

https://onlinejudge.u-aizu.ac.jp/problems/1432