Rosetta Problems

Loop Railway Plan(★4)

https://atcoder.jp/contests/typical90/tasks/typical90_bt