In today's math class, you learned how to find the equation of a polynomial function given its graph, but your friend Nemo did not, since he slept through the entire lesson. Needless to say, Nemo's act did not go unnoticed, and resulted in him being punished with extra homework questions to complete. Knowing that he won't have time to finish all of them, Nemo asks you, the best CS student in the school, to help him out.
Nemo is given
Note: all input and coefficients are guaranteed to fit in signed 64-bit integral variables (e.g. long long
in C++).
Input Specification
The first line of input will contain the integer
- The integer
, representing the degree of the polynomial function. space-separated integers , representing the x-coordinates of the roots of the function.- Two space-separated integers
and , representing the coordinates of the known point.
Output Specification
Output a single line for each of the
Sample Input
2
2
3 4
0 12
3
-2 3 4
0 48
Sample Output
1 -7 12
2 -10 -4 48
Comments