SP11603 POLTOPOL - Polynomial f(x) to Polynomial h(x)
Description
Given polynomial of degree d, f(x)=c $ _{0} $ +c $ _{1} $ x+c $ _{2} $ x $ ^{2} $ +c $ _{3} $ x $ ^{3} $ +...+c $ _{d} $ x $ ^{d} $
For each polynomial f(x) there exists polynomial g(x) such that:
-> f(x)=g(x)-g(x-1) for each integer x
-> g(0)=0
Your task is to calculate polynomial h(x)=g(x)/x
(Note : degree of polynomial h(x) = degree of polynomial f(x))
Input Format
The first line of input contain an integer T, T is number of test cases (0
Output Format
For each test case, output the coefficient of polynomial h(x) separated by space. Each coefficient of polynomial h(x) is guaranteed to be an integer.
Explanation/Hint
**「样例解释 #1」**
对于第一组数据:
+ $f(x) = 13$;
+ 满足条件的 $g(x) = 13x$;
+ $h(x) = \displaystyle \frac{g(x)}{x} = \displaystyle \frac{13x}{x} = 13$ 。
**「样例解释 #2」**
对于第二组数据:
+ $f(x) = (-1) + 2x$;
+ 满足条件的 $g(x) = x^2$;
+ $h(x) = \displaystyle \frac{g(x)}{x} = \displaystyle \frac{x^2}{x} = x = 0 + 1x$ 。
**「样例解释 #3」**
对于第三组数据:
+ $f(x) = 0 + 2x$;
+ 满足条件的 $g(x) = x + x^2$;
+ $h(x) = \displaystyle \frac{g(x)}{x} = \displaystyle \frac{x + x^2}{x} = 1 + 1x$ 。
**「数据范围」**
对于所有数据,$1 \le T \le 10^4$,$0 \le d \le 18$,$-2^{31} < c_i < 2^{31}$,且保证 $c_d \neq 0$。
Translate by @houwz351