AtCoder Beginner Contest 132
D
Blue and Red Balls
AtCoder
⌀ 1167
原题
← CE →
翻译中…

Problem Statement

翻译中…

There are $K$ blue balls and $N-K$ red balls. The balls of the same color cannot be distinguished. Snuke and Takahashi are playing with these balls.

翻译中…

First, Snuke will arrange the $N$ balls in a row from left to right.

翻译中…

Then, Takahashi will collect only the $K$ blue balls. In one move, he can collect any number of consecutive blue balls. He will collect all the blue balls in the fewest moves possible.

翻译中…

How many ways are there for Snuke to arrange the $N$ balls in a row so that Takahashi will need exactly $i$ moves to collect all the blue balls? Compute this number modulo $10^9+7$ for each $i$ such that $1 \leq i \leq K$.

翻译中…

Constraints

翻译中…
  • $1 \leq K \leq N \leq 2000$
翻译中…

Input

翻译中…

Input is given from Standard Input in the following format:

翻译中…

N K

翻译中…

Output

翻译中…

Print $K$ lines. The $i$-th line ($1 \leq i \leq K$) should contain the number of ways to arrange the $N$ balls so that Takahashi will need exactly $i$ moves to collect all the blue balls, modulo $10^9+7$.

翻译中…

样例

Input #1
5 3
Output #1
3
6
1
There are three ways to arrange the balls so that Takahashi will need exactly one move: (B, B, B, R, R), (R, B, B, B, R), and (R, R, B, B, B). (R and B stands for red and blue, respectively). There are six ways to arrange the balls so that Takahashi will need exactly two moves: (B, B, R, B, R), (B, B, R, R, B), (R, B, B, R, B), (R, B, R, B, B), (B, R, B, B, R), and (B, R, R, B, B). There is one way to arrange the balls so that Takahashi will need exactly three moves: (B, R, B, R, B).
Input #2
2000 3
Output #2
1998
3990006
327341989
Be sure to print the numbers of arrangements modulo $10^9+7$.
题目信息
题号
abc132_d
时间限制
2 s
内存限制
1024 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。