UVA11705 Grasshopper

Description

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

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11705/4f29656e883a63b833fe3a371e79b993b6e19e43.png)

Output Format

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