UVA11700 Pipes

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=117&page=show_problem&problem=2747 [PDF](https://uva.onlinejudge.org/external/117/p11700.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11700/e6bb6b9c8b68fdfd2197266ff910b7b0c04b2fdd.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11700/4010967aeb23c65fb30e67a815c7938e9f2086a3.png)

Output Format

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