Rosetta Problems

Piles of Pebbles

https://atcoder.jp/contests/arc143/tasks/arc143_c