#P5265. 多项式反三角函数
多项式反三角函数
Problem Description
Given an -degree polynomial , find a polynomial modulo such that or .
All operations are performed modulo .
Input Format
The first line contains two integers . If , compute ; if , compute .
The second line contains integers, representing the coefficients of the polynomial in order.
It is guaranteed that .
Output Format
Output one line with integers, representing the coefficients 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 of the testdata: , .
For the first points, ; for the last points, .
Translated by ChatGPT 5