Problem G
Number Theoretic Transform
You are given two polynomials. You should simply print their
product. This time you have to do it fast though and modulo
Input
The first line of input contains two positive integers
Output
Print the product of the two polynomials in the input in the
same format as the polynomials in the input. Print exactly
Sample Input 1 | Sample Output 1 |
---|---|
3 4 1 2 3 4 5 6 7 |
4 13 28 34 32 21 |
Sample Input 2 | Sample Output 2 |
---|---|
3 3 10000000 10000000 10000000 10000000 10000000 10000000 |
871938225 745632097 619325969 745632097 871938225 |