Time limit
3s
Memory limit
512 MB
You are given N integers a1,a2,…,aN. Define functions f and g 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 T and K, and the sequence a1,a2,…,aN, compute g(T,i) modulo 109+7 for every integer i such that 0≤i≤K.
The first line contains three integers N, K, and T.
The second line contains N integers a1,a2,…,aN.
Print g(T,0),g(T,1),…,g(T,K) modulo 109+7, separated by single spaces.