#K2846. Counting E-Sequences

    ID: 24827 Type: Default 1000ms 256MiB

Counting E-Sequences

Counting E-Sequences

You are given an integer F representing the number of different flower types, an integer G representing the maximum length of sequences, and an array of F integers representing the number of flowers available for each type. Although the array is provided, it does not affect the computation.

Your task is to compute, for each E with \(1 \le E \le G\), the number of unique E-sequences that can be formed. An E-sequence is defined as a selection of E distinct flower types from the F available, which is equivalent to the binomial coefficient \(\binom{F}{E}\) (taken modulo \(10^9+7\)). Note that if \(E > F\), the number of sequences is defined to be 0.

Example: For F = 4 and G = 3, the answers for \(E = 1,2,3\) are: \(\binom{4}{1}=4\), \(\binom{4}{2}=6\), \(\binom{4}{3}=4\); hence, the output is 4 6 4.

inputFormat

The input is read from standard input (stdin). The first line contains two space-separated integers (F) and (G), where (F) is the number of flower types and (G) is the maximum sequence length. The second line contains (F) space-separated integers which represent the number of flowers for each type (this list is provided for compatibility but is not used in the computation).

outputFormat

Print (G) space-separated integers on a single line. The (i)-th integer should be the number of (i)-sequences, calculated as (\binom{F}{i}) modulo (10^9+7).## sample

4 3
1 2 1 3
4 6 4