Rosetta Problems

格子グラフ

https://atcoder.jp/contests/njpc2017/tasks/njpc2017_b