Rosetta Problems

Get the treasure

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