# Multipoint Evaluation

AC一覧

## Problem Statement問題文

Given a polynomial $f(x) = \sum_{i = 0}^{N - 1} c_i x^i$ and integer sequence $p_0, p_1, ..., p_{M - 1}$. Print $f(p_i) \bmod 998244353$ for each $p_i$.

## Constraints制約

• $1 \leq N, M \leq 2^{17}(=131072)$
• $0 \leq c_i, p_i < 998244353$
• $c_{N - 1} \neq 0$

## Input入力

$N$ $M$
$c_0$ $c_1$ ... $c_{N-1}$
$p_0$ $p_1$ ... $p_{M-1}$


## Output出力

$f(p_0)$ $f(p_1)$ ... $f(p_{M-1})$


## Sampleサンプル

### # 1

4 5
1 2 3 4
5 6 7 8 9

586 985 1534 2257 3178


### # 2

1 1
10000000
10000000

10000000


Timelimit: 10 secs

Before submitting, please confirm terms and conditions