Rosetta Problems

貢物(Tribute)

https://atcoder.jp/contests/tkppc2/tasks/tkppc2016_g