UVA10516 Another Counting Problem

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=17&page=show_problem&problem=1457 [PDF](https://uva.onlinejudge.org/external/105/p10516.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10516/ae788f89914715ed3e3b7a90b71e08badf1f138f.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10516/38b10673b928d40c4548abff47696057b4d01fe0.png)

Output Format

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