Rosetta Problems

Water Supply Plan

https://atcoder.jp/contests/awc0177/tasks/awc0177_c