#P1516E. Baby Ehab Plays with Permutations
Baby Ehab Plays with Permutations
No submission language available for this problem.
Description
This time around, Baby Ehab will play with permutations. He has cubes arranged in a row, with numbers from to written on them. He'll make exactly operations. In each operation, he'll pick up 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 between and .
The only line contains integers and (, ) — the number of cubes Baby Ehab has, and the parameter from the statement.
Print space-separated integers. The -th of them is the number of possible sequences you can end up with if you do exactly operations. Since this number can be very large, print the remainder when it's divided by .
Input
The only line contains integers and (, ) — the number of cubes Baby Ehab has, and the parameter from the statement.
Output
Print space-separated integers. The -th of them is the number of possible sequences you can end up with if you do exactly operations. Since this number can be very large, print the remainder when it's divided by .
Samples
Note
In the second example, there are sequences he can get after swap, because there are pairs of cubes he can swap. Also, there are sequences he can get after swaps:
- ,
- ,
- .