Series Sum

All submissions for this problem are available.
Read problems statements in Mandarin chinese, Russian and Vietnamese as well.
You are given $N$ integers $a_1, a_2, \dots, a_N$. Let's define functions $f$ and $g$: $$f(x, k) = (x + a_1)^k + (x + a_2)^k + \dots + (x + a_N)^k$$ $$g(t, k) = f(0, k) + f(1, k) + \dots + f(t, k)$$ You are also given integers $T$ and $K$. Calculate $g(T, i)$ modulo $10^9 + 7$ for each $i$ between $0$ and $K$ inclusive. ### Input  The first line of the input contains three spaceseparated integers $N$, $K$ and $T$.  The second line contains $N$ spaceseparated integers $a_1, a_2, \dots, a_N$. ### Output Print a single line containing $K+1$ spaceseparated integers — the values of $g(T, 0), g(T, 1), \dots, g(T, K)$ modulo $10^9 + 7$. ### Constraints  $1 \le N \le 10^5$  $1 \le K \le 5 \cdot 10^4$  $1 \le T \le 10^{18}$  $0 \le a_i \lt 10^9 + 7$ ### Subtasks **Subtask #1 (10 points):** $N = 1$ **Subtask #2 (10 points):** $a_i = a_1 ^ i$ modulo $10^9 + 7$ for each valid $i$ **Subtask #3 (10 points):** $a_i = a_1 + i  1$ modulo $10^9 + 7$ for each valid $i$ **Subtask #4 (70 points):** original constraints ### Example Input ``` 2 3 4 0 1 ``` ### Example Output ``` 10 25 85 325 ```Author:  chemthan 
Editorial  https://discuss.codechef.com/problems/SERSUM 
Tags  chemthan, convolution, fft, may18, powerseries 
Date Added:  28022018 
Time Limit:  6 sec 
Source Limit:  50000 Bytes 
Languages:  C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, rust, SCALA, swift, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, kotlin, PERL6, TEXT, SCM chicken, CLOJ, COB, FS 
Comments
 Please login at the top to post a comment.
SUCCESSFUL SUBMISSIONS
Fetching successful submissions