Rosetta Problems

Accumulation of Wealth

https://atcoder.jp/contests/abc409/tasks/abc409_g