3627. Calculation

单点时限: 3.0 sec

内存限制: 512 MB

You are given an array $A$ with $N$ nodes. The array nodes are numbered from $0$ to $N-1$ (represented by $a_i$).

Then you define a new array $B$. The $i$-th ($0 \le i < N$) node of $B$ is $b_i$:

$$b_i = \sum_{j=0}^{N-1} (a_j (4^i \cdot p + q)^j)) \bmod 200003$$

Please calculate array $B$.

输入格式

The first line contains three integers $N$, $p$, $q$ ($1 \le N \le 100000, 1 \le p, q \le 10$).

The next line contains $N$ integers of array $A$. ($0 \le a_i \le 1000$)

输出格式

Output $N$ integers of array $B$ in one line separated with space.

样例

Input
5 1 1
1 2 3 4 5
Output
129 3711 38153 163078 120839
Input
3 1 2
1 1 1
Output
13 43 343

1 人解决,8 人已尝试。

1 份提交通过,共有 58 份提交。

9.9 EMB 奖励。

创建: 5 年,8 月前.

修改: 5 年,8 月前.

最后提交: 3 年,4 月前.

来源: 2018 Shanghai Metropolitan Contest

题目标签
fft