UVA12914 Sum of all permutations

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=862&page=show_problem&problem=4779 [PDF](https://uva.onlinejudge.org/external/129/p12914.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12914/e1c83b31231204d9ad1b4ee10f60a3154da6bcc9.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12914/0f8ac3c6fb5d09f4e744853dfc078bfa2ebb8fa6.png)

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12914/1394f177666c34bec1db55a13fd5a548f44cc4fe.png)