<PREV Problem:
NEXT>
Solved by 64 users: ...
UserDateAttemptTimeCMSC
NIGHTFIT17 jun 2013C++1600.05141 
WsemirZ14 mar 2009C1000.21143 
mikl20 aug 2007C++500.05153 
WsemirZ14 mar 2009C900.21153 
NIGHTFIT17 jun 2013C++1500.04156 
WsemirZ14 mar 2009Kylix200.20157 
NIGHTFIT07 jul 2011C++700.04158 
NIGHTFIT07 jul 2011C++800.04158 
vi00217 jul 2007Ruby1809.05161 
Robert_Gerbicz08 jun 2008C200.04165 
NIGHTFIT17 jun 2013C++1300.04166 
tomek28 feb 2007C++1500.14176 
Robert_Gerbicz08 jun 2008C300.04191 
popo26 feb 2009C++400.05197 
dan27 apr 2007C++100.27203 
Vasyl30 sep 2008C++900.06205 
DAV02 jun 2009C++1300.04215 
vi00216 jul 2007Ruby1003.72232 
Languages
C++
56
C
4
Kylix
3
Java
2
Ruby
1
Python
1
FPC
1
 > 
 > 
 > 
 > 
 > 
 > 
 > 
 > 
 > 
 > 

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 190ms

SW soft NIX
ID = 100.26.179.196