Rosetta Problems

Cave Exploration and Underground Waterways

https://atcoder.jp/contests/awc0094/tasks/awc0094_e