UVA10724 Road Construction

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=19&page=show_problem&problem=1665 [PDF](https://uva.onlinejudge.org/external/107/p10724.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10724/fffc347adff634fde2d9175992bbe0774e380392.png)

Input Format

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

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10724/7b793bb1fcb5ec6413fddbb1cf773c501a84e267.png)