#P3711. 仓鼠的数学题
仓鼠的数学题
Description
A hamster saw a problem on some OJ. Let . This problem inputs . Suppose . You are asked to compute .
The hamster thought for two seconds and solved it in a flash. He found the constraints were only , so he casually added two zeros.
But the hamster was too lazy to make testdata, so he threw this problem to you.
Input Format
The first line contains an integer .
The second line contains space-separated non-negative integers: .
Output Format
Output space-separated integers, the coefficients of the answer polynomial, meaning the polynomial is . The coefficients are taken modulo .
It can be proved that the degree of the polynomial is .
2
3 3 3
3 5 3 1
Hint
For of the testdata, .
For of the testdata, .
For of the testdata, .
For of the testdata, .
Both the input and output polynomial coefficients are taken modulo and are non-negative integers in .
Translated by ChatGPT 5
京公网安备 11011102002149号