Codeforces Round 138 (Div. 2)
E
Partial Sums
Codeforces
未评级
原题
← D→
翻译中…

You've got an array $*a*$, consisting of $*n*$ integers. The array elements are indexed from 1 to $*n*$. Let's determine a two step operation like that:

翻译中…
  1. First we build by the array $*a*$ an array $*s*$ of partial sums, consisting of $*n*$ elements. Element number $*i*$ ($1 ≤ *i* ≤ *n*$) of array $*s*$ equals image. The operation $*x* *mod* *y*$ means that we take the remainder of the division of number $*x*$ by number $*y*$.
  2. Then we write the contents of the array $*s*$ to the array $*a*$. Element number $*i*$ ($1 ≤ *i* ≤ *n*$) of the array $*s*$ becomes the $*i*$-th element of the array $*a*$ ($*a*_{*i*} = *s*_{*i*}$).
翻译中…

You task is to find array $*a*$ after exactly $*k*$ described operations are applied.

翻译中…

Input

翻译中…

The first line contains two space-separated integers $*n*$ and $*k*$ ($1 ≤ *n* ≤ 2000$, $0 ≤ *k* ≤ 10^{9}$). The next line contains $*n*$ space-separated integers $*a*_{1}, *a*_{2}, ..., *a*_{*n*}$ — elements of the array $*a*$ ($0 ≤ *a*_{*i*} ≤ 10^{9}$).

翻译中…

Output

翻译中…

Print $*n*$ integers  — elements of the array $*a*$ after the operations are applied to it. Print the elements in the order of increasing of their indexes in the array $*a*$. Separate the printed numbers by spaces.

翻译中…

样例

Input #1
3 1
1 2 3
Output #1
1 3 6
InputCopy OutputCopy
Input #2
5 0
3 14 15 92 6
Output #2
3 14 15 92 6
InputCopy OutputCopy
题目信息
题号
224E
时间限制
4 s
内存限制
256 MB

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。