#P5667. 拉格朗日插值2
拉格朗日插值2
Problem Description
Given the point values of a polynomial of degree at most , and a positive integer , find .
The answer should be taken modulo .
Input Format
The first line contains two positive integers , with the meanings as described above.
The second line contains integers, representing .
Output Format
Output one line with integers, representing .
5 6
1 1 4 5 1 4
54 232 673 1579 3232 6007
Hint
Constraints
For of the testdata:
, , .
Translated by ChatGPT 5