Rosetta Problems

とてもたのしいたのしい家庭菜園 (Growing Vegetables is Fun 5)

https://atcoder.jp/contests/joisp2024/tasks/joisp2024_f