CF1516E Baby Ehab Plays with Permutations
Description
This time around, Baby Ehab will play with permutations. He has $ n $ cubes arranged in a row, with numbers from $ 1 $ to $ n $ written on them. He'll make exactly $ j $ operations. In each operation, he'll pick up $ 2 $ cubes and switch their positions.
He's wondering: how many different sequences of cubes can I have at the end? Since Baby Ehab is a turbulent person, he doesn't know how many operations he'll make, so he wants the answer for every possible $ j $ between $ 1 $ and $ k $ .
Input Format
N/A
Output Format
N/A
Explanation/Hint
In the second example, there are $ 3 $ sequences he can get after $ 1 $ swap, because there are $ 3 $ pairs of cubes he can swap. Also, there are $ 3 $ sequences he can get after $ 2 $ swaps:
- $ [1,2,3] $ ,
- $ [3,1,2] $ ,
- $ [2,3,1] $ .