UVA12173 White Water Rafting

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=243&page=show_problem&problem=3325 [PDF](https://uva.onlinejudge.org/external/121/p12173.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12173/c01bf032e193f07f8193e890f5e4d34507d189e8.png)

Input Format

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

Output Format

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