Rosetta Problems

Yet Another Grid Task

https://atcoder.jp/contests/abc311/tasks/abc311_f