UVA10462 Is There A Second Way Left?

Description

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

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10462/2ecd9fb0311c30d0acbb90e7db8a018cdc72ef0f.png)

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10462/362641b23cc29d7a2ce8c43c2e58ab9dacd3d9e1.png)