Rosetta Problems

Maintenance of Waterways

https://atcoder.jp/contests/awc0098/tasks/awc0098_e