UVA10938 Flea circus

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=21&page=show_problem&problem=1879 [PDF](https://uva.onlinejudge.org/external/109/p10938.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10938/66160c1ebb4b2f29a4e8c7e575d16fad1833d084.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10938/89256db02d1c44725b915ed7649e884ec7081721.png)

Output Format

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