cho.sh
Notes
Loading...

f and g

Time limit

3s

Memory limit

512 MB

Problem

You are given NNN integers a1,a2,…,aNa_1, a_2, \dots, a_Na1​,a2​,…,aN​. Define functions fff and ggg as follows.

[f(x,k) = (x + a_1)^k + (x + a_2)^k + \cdots + (x + a_N)^k]

[g(t,k) = f(0,k) + f(1,k) + \cdots + f(t,k)]

Given integers TTT and KKK, and the sequence a1,a2,…,aNa_1, a_2, \dots, a_Na1​,a2​,…,aN​, compute g(T,i)g(T,i)g(T,i) modulo 109+710^9+7109+7 for every integer iii such that 0≤i≤K0 \le i \le K0≤i≤K.

Input

The first line contains three integers NNN, KKK, and TTT.

The second line contains NNN integers a1,a2,…,aNa_1, a_2, \dots, a_Na1​,a2​,…,aN​.

Output

Print g(T,0),g(T,1),…,g(T,K)g(T,0), g(T,1), \dots, g(T,K)g(T,0),g(T,1),…,g(T,K) modulo 109+710^9+7109+7, separated by single spaces.

Constraints

  • 1≤N≤1051 \le N \le 10^51≤N≤105
  • 1≤K≤5⋅1041 \le K \le 5 \cdot 10^41≤K≤5⋅104
  • 1≤T≤10181 \le T \le 10^{18}1≤T≤1018
  • 0≤ai<109+70 \le a_i < 10^9 + 70≤ai​<109+7