Rosetta Problems

Well-defined Path Queries on a Namori

https://atcoder.jp/contests/abc266/tasks/abc266_f