UVA10553 Treasure Map

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=17&page=show_problem&problem=1494 [PDF](https://uva.onlinejudge.org/external/105/p10553.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10553/6a93a7392b1502ad156b0c77a66923665b523e39.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10553/1306989bf934bd2693a352bae00562fc382f76d3.png)

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10553/97e71eecdf300b48ccbb6a1c397cef7d8ea9ca3f.png)