Rosetta Problems

Beautiful Path

https://atcoder.jp/contests/abc324/tasks/abc324_f