UVA825 Walking on the Safe Side

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=10&page=show_problem&problem=766 [PDF](https://uva.onlinejudge.org/external/8/p825.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA825/7c563c4873da31da66e15836c0a70a8b923e90f6.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA825/97c07eb84434845aad0c11042e7bc4a6fd9b7cf6.png)

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA825/1ed514920e1a3b6585736a58b16c3f0e6b59c08e.png)