<PREV Problem:
NEXT>
Solved by 64 users: ...
 < 
 < 
 < 
 < 
 < 
 < 
 < 
 < 
 < 
 < 

Polynom modulo P.

Time limit = 2 second(s)

You are given prime number P and P numbers A(0) .. A(P-1). You should find polynom Q(x) of degree P — 1 (or less):

Input The first line contains P, 1 ≤ P ≤ 1000. The second line contains P values A(0), A(1), ..., A(P-1).

Output You should print P coefficients of the polynom starting from the lowest.

Input#1
5
0 1 2 3 4

Output#1
0 1 0 0 0

Input#2
5
4 3 2 1 0

Output#2
4 4 0 0 0

Author:
Known problem. Tests and description --
9 December 2006

<PREV | Problem set | Search related messages | NEXT>


© acm.mipt DevGroup
The page was generated in 210ms

SW soft NIX
ID = 54.80.60.91