UVA168 Theseus and the Minotaur

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=3&page=show_problem&problem=104 [PDF](https://uva.onlinejudge.org/external/1/p168.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA168/7281c7a6d5153c6b1ce914c5f26ea46d9bdf5dbc.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA168/32d1b207d628e7bc59c32393a5f94d0b93729a57.png)

Output Format

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