#P5265. 多项式反三角函数

    ID: 5996 远端评测题 1000ms 125MiB 尝试: 0 已通过: 0 难度: 9 上传者: 标签>倍增O2优化构造快速数论变换 NTT

多项式反三角函数

Problem Description

Given an (n1)(n - 1)-degree polynomial A(x)A(x), find a polynomial F(x)F(x) modulo xnx^n such that F(x)asinA(x)F(x)\equiv\text{asin}\:A(x) or F(x)atanA(x)F(x)\equiv\text{atan}\:A(x).

All operations are performed modulo 998244353998244353.

Input Format

The first line contains two integers n,typen,type. If type=0type=0, compute asin\text{asin}; if type=1type=1, compute atan\text{atan}.

The second line contains nn integers, representing the coefficients a0,a1,,an1a_0,a_1,\cdots,a_{n-1} of the polynomial in order.

It is guaranteed that a0=0a_0=0.

Output Format

Output one line with nn integers, representing the coefficients f0,f1,,fn1f_0,f_1,\cdots,f_{n-1} of the answer polynomial.

8 0
0 4 2 6 1 5 3 7
0 4 2 665496252 17 399297879 332748370 570426983
8 1
0 4 2 6 1 5 3 7
0 4 2 665496220 998244322 399297839 332748518 570424795

Hint

For 100%100\% of the testdata: n105n\leq10^5, ai[0,998244352]Za_i\in[0,998244352]\cap\mathbb{Z}.

For the first 55 points, type=0type=0; for the last 55 points, type=1type=1.

Translated by ChatGPT 5