UVA10310 Dog and Gopher

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=15&page=show_problem&problem=1251 [PDF](https://uva.onlinejudge.org/external/103/p10310.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10310/f534c96d67d1bcaf7c59e32d38ced88a9d01d18f.png)

Input Format

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

Output Format

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