F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

RXD and functions

Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 524288/524288 K (Java/Others)
Total Submission(s): 1583    Accepted Submission(s): 662


Problem Description
RXD has a polynomial function $f(x)$, $f(x) = \sum_{i = 0}^{n}{c_ix^i}$
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 $a_1, a_2, a_3, \dots , a_m$, RXD generates a polynomial function sequence $g_i$, in which $g_0 = f$ and $g_i = Tr(g_{i - 1}, a_i)$
RXD wants you to find $g_m$, in the form of $\sum_{i = 0}^{m}{b_ix^i}$
You need to output $b_i$ module 998244353.
$n\leq 10^5$
 

Input
There are several test cases, please keep reading until EOF.
For each test case, the first line consists of 1 integer $n$, which means $\deg F$.
The next line consists of $n + 1$ intergers $c_i, 0 \leq c_i < 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 $a_i$.
There are 11 test cases.
$0<=ai<998244353$
$\sum m\leq 10^5$
 

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

Sample Input
2 0 0 1 1 1
 

Sample Output
1 998244351 1
 

Hint

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

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-11-21 21:08:16, Gzip enabled