Rosetta Problems

Fruit Picking Festival

https://atcoder.jp/contests/awc0117/tasks/awc0117_d