UVA12427 Donkey of the Sultan

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=279&page=show_problem&problem=3858 [PDF](https://uva.onlinejudge.org/external/124/p12427.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12427/ca724d1885883c583e15b7a186e5da0886fc82de.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12427/3afe51ff989e7eb549e9f1523cae4b076eb2c445.png)

Output Format

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