<PREV Problem:
NEXT>
Solved by 19 users: var, JohnJones_001, dan, Chmeli_BSU, Norbert, MaxBuzz, UdH-WiNGeR, Kuznetsov_S, defrager, WsemirZ, zloy_mipt, MasterYoda, DAV, akopich, RAVEman, fetetriste, vi002, Dest, s01A06.
 < 
 < 
 < 
 < 
 < 
 < 
 < 
 < 
 < 
 < 

Series

Time limit = 2.0 second(s)

Memory limit = 64 Mb

Output Teylor series of 1/P(x) for given polynom P(x). Degree of P(x) is less tnan 51.

Input Max degree M and polynop P(x). 0 ≤ M ≤ 50. Absolute values of nominators and denominators are less than 1001.

Output Rules: 1) x^1 should be writen as x, 2) -1 and 1 should not be written, output just sign 3) do not write + before the first element. 4) write space before x.

Input#1
5
1 + 10 x - 1/10 x^2

Output#1
1 - 10 x + 1001/10 x^2 - 1002 x^3 + 1003001/100 x^4 - 1004003/10 x^5

Input#2
4
2 + x^2

Output#2
1/2 - 1/4 x^2 + 1/8 x^4

Input#3
3
1 - x - 1/2 x^2 - 1/3 x^3

Output#3
1 + x + 3/2 x^2 + 7/3 x^3

Author:
Artem Voroztsov, individual MIPT contest, 21 sep., 2008
20 September 2008

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


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

SW soft NIX
ID = 54.80.60.91