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:
Note: This expression represents that the qth element of Fi(X) is the prefix sum of the first q elements of Fi−1(X), where i≥1.
Your task is to determine M integers, where the zth integer is the (N−1)th element of FK(Bz),1≤z≤M.
As these numbers can be large, print them as modulo 109+7.
Input format
Output format
Print M space-separated integers, where the zth integer denotes the (N−1)th element of Fk(Bz),1≤z≤M. As these numbers can be large, you are required to print them as modulo 109+7.
Constraints
1≤N,M,K≤1051≤A[i]<109+7
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]