#P4245. 【模板】任意模数多项式乘法
【模板】任意模数多项式乘法
Description
Given polynomials , compute . The coefficients are taken modulo , and it is not guaranteed that can be written in the form .
Input Format
The input consists of lines.
The first line contains integers , representing the degrees of and , and the modulus .
The second line contains integers; the -th integer denotes the coefficient of the -th term of .
The third line contains integers; the -th integer denotes the coefficient of the -th term of .
Output Format
Output integers. The -th integer denotes the coefficient of the -th term of .
5 8 28
19 32 0 182 99 95
77 54 15 3 98 66 21 20 38
7 18 25 19 5 13 12 2 9 22 5 27 6 26
Hint
For of the testdata, , , .
Translated by ChatGPT 5
京公网安备 11011102002149号