#P7813. Array Repairing
Array Repairing
Array Repairing
Problem Description
Given an integer , a sequence is randomly generated with equal probability, namely, , . Note that it may be not a permutation of . To turn it into , you can perform any of the following two operations for any times: 1.Choose , swap costing . 2.Choose , set costing . For example, if you perform operations of the first kind for times and perform operations of the second kind for times, then it will cost you . Denote as the minimum total cost for the sequence with the parameter . For each , print the mathematical expectation . Now, you need to answer the above question for each . That is to say, you should print values in total.
Input
One line contains only one integer , .
Output
You should output lines with each containing values , separated by two spaces.
Sample Input
example 1:
1
example 2:
2
Sample Output
example 1:
0 0 0
example 2:
0 0 0
0 249561089 748683266
Source
2020 Multi-University Training Contest 5