Rosetta Problems

Collecting Gems

https://atcoder.jp/contests/awc0102/tasks/awc0102_c