UVA10881 Piotr's Ants

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=20&page=show_problem&problem=1822 [PDF](https://uva.onlinejudge.org/external/108/p10881.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10881/c3aa7b225a5f6819e4d17b526832b755b22b5a99.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10881/2d71b937a92ec02179fbc9361c321af29ce6a0c0.png)

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10881/20ef5d5cc4fa79f027dc27848aa97f90dcf2b627.png)