UVA162 Beggar My Neighbour

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=3&page=show_problem&problem=98 [PDF](https://uva.onlinejudge.org/external/1/p162.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA162/41894ee6c3b7151a6421c3b94c5c88c61ad0535e.png)

Input Format

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

Output Format

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