UVA12607 Amazing Maze

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=602&page=show_problem&problem=4285 [PDF](https://uva.onlinejudge.org/external/126/p12607.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12607/8a4fa15b4e424af21ff51d0bf13a02533cc793ff.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12607/7d66118c2b5108ebea4b577ffa79595000ae1d36.png)

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12607/0a41f4488edf3d268b0f2a7a0ad1ae1e207f7d55.png)