Angie and Functions (Hard)
View as PDFAngie is studying functions!
For her homework, she was asked to figure out the coefficients  in the following function:
(All the coefficients are integers)
Angie has  arbitrary integer 
 coordinate pairs on the polynomial, and wants you to help her find the coefficients.
Can you help her?
Input Specification
The first line of input will be  (
), the degree number of the polynomial.
The next  lines will each contain a single coordinate pair 
 indicating that 
.
The  and 
 values will be given modulo 
, and all 
 values will be unique.
Output Specification
The output should contain  integers, the coefficients of the polynomial in descending degree. The coefficients should be output modulo 
.
Sample Input
2
0 0
1 1
2 4
Sample Output
1 0 0
Comments