UVA754 Treasure Hunt

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=9&page=show_problem&problem=695 [PDF](https://uva.onlinejudge.org/external/7/p754.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA754/04f2a819ed5c19cb5872e7941bedcb8ca0394604.png)

Input Format

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

Output Format

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