Functions in arrays

3

6 votes
Hard, Combinatorics, Linear Algebra, FFT, polynomials, Fourier Transformations, Mathematics
Problem

You are provided with an array A of size N that contains integers and two additional integers K and M. You have defined the following functions:

  • M arrays are defined in such a way where the zth of them is Bz=[Az0,Az1,...AzN1],1zM.
  • For an array X, you define a series of K+1 arrays F0(X),F1(X)...FK(X), where:
    • F0(X)=X
    • Fi(X)[q]=qj=0Fi1(X)[j],1iK,0qN1

Note: This expression represents that the qth element of Fi(X) is the prefix sum of the first q elements of Fi1(X), where i1.

Your task is to determine M integers, where the zth integer is the (N1)th element of FK(Bz),1zM.

As these numbers can be large, print them as modulo 109+7.

Input format

  • First line: Three space-separated integers N, M, and K
  • Second line: N space-separated integers where the ith integer denotes A[i]

Output format

Print M space-separated integers, where the zth integer denotes the (N1)th element of Fk(Bz),1zM. As these numbers can be large, you are required to print them as modulo 109+7.

Constraints

1N,M,K1051A[i]<109+7

Time Limit: 5
Memory Limit: 256
Source Limit:
Explanation

B1=[1,2,3], F0(B1)=[1,2,3],F1(B1)=[1,3,6],F2(B1)=[1,4,10].

B2=[1,4,9], F0(B2)=[1,4,9],F1(B2)=[1,5,14],F2(B2)=[1,6,20]

B3=[1,8,27], F0(B3)=[1,8,27],F1(B3)=[1,9,36],F2(B3)=[1,10,46]

Editor Image

?