UVA12922 Crossing the river

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=862&page=show_problem&problem=4801 [PDF](https://uva.onlinejudge.org/external/129/p12922.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12922/ad8a42146897f04fed9d90d0ce350d056f6cc881.png)

Input Format

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

Output Format

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