Under construction

Still being built. Things may change

f and g

Time limit3sMemory limit512 MB

Summary
Compute g(T,k)=sum_{x=0}^{T} sum_i (x+a_i)^k mod 1e9+7 for every k from 0 to K, given N up to 1e5, K up to 5e4, T up to 1e18.
Level

Hard10 of 10

Topics
Math, Combinatorics, Divide and conquer, Number theory
Solved
No attempts yet

Problem

You are given NN integers a1,a2,…,aNa_1, a_2, \dots, a_N. Define functions ff and gg 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 TT and KK, and the sequence a1,a2,…,aNa_1, a_2, \dots, a_N, compute g(T,i)g(T,i) modulo 109+710^9+7 for every integer ii such that 0≤i≤K0 \le i \le K.

Input

The first line contains three integers NN, KK, and TT.

The second line contains NN integers a1,a2,…,aNa_1, a_2, \dots, a_N.

Output

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

Constraints

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

Examples1

  1. Example 1

    Input
    2 3 4
    0 1
    
    Expected output
    10 25 85 325