#P5273. 【模板】多项式幂函数(加强版)

    ID: 5958 远端评测题 4000ms 512MiB 尝试: 0 已通过: 0 显示难度省选/NOI− 上传者: 标签>数学2019快速数论变换 NTT

【模板】多项式幂函数(加强版)

Background

Link to the normal version.

This is a template problem with no background.

Problem Description

Given a degree n1n-1 polynomial A(x)A(x), find a polynomial B(x)B(x) under mod xn\bmod\ x^n such that B(x)(A(x))k (mod xn)B(x) \equiv (A(x))^k \ (\bmod\ x^n).

All polynomial coefficients are computed under mod 998244353\bmod\ 998244353.

Input Format

The first line contains two integers n,kn, k.

The next line contains nn integers, which are the coefficients of A(x)A(x) in order: a0,a1,...,an1a_0, a_1, ..., a_{n-1}.

Output Format

Output nn integers, which are the first nn coefficients of B(x)B(x) in order: b0,b1,...,bn1b_0, b_1, ..., b_{n-1}, each being the smallest non-negative integer modulo 998244353998244353.

2 2
1 1
1 2

Hint

For 100%100\% of the testdata, 1<n1051 < n \leq 10^5, 0k101050 \leq k \leq 10^{10^5}, ai[0,998244352]a_i \in [0, 998244352].

Data update time.

Translated by ChatGPT 5