UVA10403 Escape from Tut's Tomb

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=16&page=show_problem&problem=1344 [PDF](https://uva.onlinejudge.org/external/104/p10403.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10403/a75ac404ca924d64815e791b1695bb7d107b96e7.png)

Input Format

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

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10403/6267580a1ed7515f151154a90028d92fb09d5bdc.png)