UVA12645 Water Supply

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=602&page=show_problem&problem=4393 [PDF](https://uva.onlinejudge.org/external/126/p12645.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12645/fe22b06459273a4b52615204c0a62885a076b080.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12645/dab187be711ee408252ff2813fce73a7c7d7f24e.png)

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12645/5be81848b59e74b663f5d594d7e1e561af9a8d30.png)