UVA13204 Count these Permutations

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=878&page=show_problem&problem=5127 [PDF](https://uva.onlinejudge.org/external/132/p13204.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA13204/49c2bdf38c69855236fc74907d9f4e38f5377443.png)

Input Format

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

Output Format

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