Rosetta Problems

Wine Thief

https://atcoder.jp/contests/arc120/tasks/arc120_f