UVA11309 Counting Chaos

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=25&page=show_problem&problem=2284 [PDF](https://uva.onlinejudge.org/external/113/p11309.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11309/296867d18c3531b5959eaff9d0106d0076814cf1.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11309/13173444ea21f679b67935e1589ef62eb7588d9d.png)

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11309/50aa902c2114e6d169500eee1a17f54535aad8e5.png)