Rosetta Problems

Plant Planning(★4)

https://atcoder.jp/contests/typical90/tasks/typical90_br