Rosetta Problems

地铁修建

https://www.acwing.com/problem/content/3248