UVA12862 Intrepid climber

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=861&page=show_problem&problem=4727 [PDF](https://uva.onlinejudge.org/external/128/p12862.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12862/ac93464dc5c1faefc2cb4f6c01b739ec4721f0ad.png)

Input Format

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

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12862/72230c1f789d87bc680589d68f2ae07f23e57db7.png)