题目背景
This problem comes from the repository https://github.com/yosupo06/library-checker-problems.
题目描述
Given integers N,a,r and integer sequence y0,y1,…,yN−1. It is guaranteed that ari≡arj(mod998244353) for 0≤i<j≤N−1.
Calculate a polynomial f(x)=∑i=0N−1cixi∈Z[x] s.t. f(ari)≡yi(mod998244353) is satisfied for each i.
Also, 0≤ci<998244353 must be satisfied.
输入格式
N a r
y0 y1 … yN−1
输出格式
c0 c1 … cN−1
4 2 10
17 1241 120401 12004001
1 2 3 0
1 0 0
100
100
提示
- 0≤N≤219
- 0≤a<998244353
- 0≤r<998244353
- 0≤yi<998244353
- $ar^i\not\equiv ar^j \pmod{998244353}\,(0\leq i<j\leq N-1)$