CF1516E.Baby Ehab Plays with Permutations
普及/提高-
通过率:0%
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
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 .
输入格式
The only line contains 2 integers n and k ( 2≤n≤109 , 1≤k≤200 ) — the number of cubes Baby Ehab has, and the parameter k from the statement.
输出格式
Print k space-separated integers. The i -th of them is the number of possible sequences you can end up with if you do exactly i operations. Since this number can be very large, print the remainder when it's divided by 109+7 .
输入输出样例
输入#1
2 3
输出#1
1 1 1
输入#2
3 2
输出#2
3 3
输入#3
4 2
输出#3
6 12
说明/提示
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] .