Responsive image

问题 1814 --RXD and functions

1814: RXD and functions

时间限制: 4 Sec  内存限制: 128 MB
提交: 1  解决: 1
[提交][状态][讨论版][命题人:]

题目描述

RXD has a polynomial function f(x)f(x)=∑ni=0cixi
RXD has a transformation of function Tr(f,a), it returns another function g, which has a property that g(x)=f(x−a).
Given a1,a2,a3,…,am, RXD generates a polynomial function sequence gi, in which g0=f and gi=Tr(gi−1,ai)
RXD wants you to find gm, in the form of ∑mi=0bixi
You need to output bi module 998244353.
n≤105

输入描述

There are several test cases, please keep reading until EOF.
For each test case, the first line consists of 1 integer n, which means degF.
The next line consists of n+1 intergers ci,0≤ci<998244353, which means the coefficient of the polynomial.
The next line contains an integer m, which means the length of a.
The next line contains m integers, the i - th integer is ai.
There are 11 test cases.
0<=ai<998244353
∑m≤105

输出描述

For each test case, output an polynomial with degree n, which means the answer.
 

样例输入

2
0 0 1
1
1
 

样例输出

1 998244351 1 

提示

$(x - 1) ^ 2 = x^2 - 2x + 1$

来源

 

[提交][状态]
ACM算法攻关部