UVA10940 Throwing cards away II

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=21&page=show_problem&problem=1881 [PDF](https://uva.onlinejudge.org/external/109/p10940.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10940/2734c82834656447346f7fe77f4bc0a4e5116d3c.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10940/52e384d518bfc3fd826abb7a1c646e3466d86c27.png)

Output Format

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