UVA12363 Hedge Mazes

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=278&page=show_problem&problem=3785 [PDF](https://uva.onlinejudge.org/external/123/p12363.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12363/026f7b8800730b6c3bb9a42d73ee437454b85f63.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12363/02bb7f4883eedd0b2d9de310dcfc3980cb5c2f19.png)

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12363/6dddcdf2b0ff5bcb27f5d26a692c9af9dbf59128.png)