Rosetta Problems

Reservoirs and Waterways

https://atcoder.jp/contests/awc0172/tasks/awc0172_c