#P6667. [清华集训 2016] 如何优雅地求和
[清华集训 2016] 如何优雅地求和
Description
There is a polynomial function whose highest power is . Define a transformation :
Now given and , compute .
For some reason, the function is given in point-value form. That is, numbers are given, and . It can be proven that this function is unique.
Input Format
The first line contains three integers , with meanings as described above.
The second line contains integers, representing .
Output Format
Output one number in one line as the answer, taken modulo .
4 1 332748118
0 1
332748119
4 3 12
0 1 8 27
46704
Hint
Explanation for Sample
After calculation, .
Constraints
For all testdata, it is guaranteed that , , and .
Translated by ChatGPT 5
京公网安备 11011102002149号