CF1516E.Baby Ehab Plays with Permutations

省选/NOI-

通过率:0%

时间限制:2.00s

内存限制:256MB

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

This time around, Baby Ehab will play with permutations. He has nn cubes arranged in a row, with numbers from 11 to nn written on them. He'll make exactly jj operations. In each operation, he'll pick up 22 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 jj between 11 and kk.

这一次,Baby Ehab 将与排列(permutation)进行游戏。他有 nn 个立方体排成一行,上面分别写有数字 11 到 nn。他将恰好执行 jj 次操作。在每次操作中,他将挑选出 22 个立方体并交换它们的位置。

他思考着:最终可能得到多少种不同的立方体序列?由于 Baby Ehab 是一个反复无常的人,他并不知道自己究竟会执行多少次操作,因此他希望得到每个可能的 jj(从 11 到 kk)所对应的答案。

输入格式

The only line contains 22 integers nn and kk (2≤n≤1092 \le n \le 10^9, 1≤k≤2001 \le k \le 200) — the number of cubes Baby Ehab has, and the parameter kk from the statement.

唯一一行包含 22 个整数 nn 和 kk(2≤n≤1092 \le n \le 10^9,1≤k≤2001 \le k \le 200)——分别表示 Baby Ehab 拥有的立方体数量,以及题目描述中的参数 kk。

输出格式

Print kk space-separated integers. The ii-th of them is the number of possible sequences you can end up with if you do exactly ii operations. Since this number can be very large, print the remainder when it's divided by 109+710^9+7.

输出 kk 个以空格分隔的整数。其中第 ii 个整数表示恰好执行 ii 次操作后可能得到的不同序列的数量。由于该数量可能非常大,请输出其对 109+710^9+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 33 sequences he can get after 11 swap, because there are 33 pairs of cubes he can swap. Also, there are 33 sequences he can get after 22 swaps:

  • [1,2,3][1,2,3],
  • [3,1,2][3,1,2],
  • [2,3,1][2,3,1].

在第二个例子中,经过 1 次交换后,他可以得到 33 个不同的序列,因为共有 33 对立方体可以交换。此外,经过 2 次交换后,他也可以得到 33 个不同的序列:

  • [1,2,3][1,2,3],
  • [3,1,2][3,1,2],
  • [2,3,1][2,3,1]。

输入解题思路,AI测评打分。不知道怎么写?

首页