Write a program to differentiate a polynomial in x.
Here's how to differentiate a polynomial in the form
$$$c_nx^n+c_{n-1}x^{n-1}+\cdots+c_1x+c_0$$$
Each term $$$c_ix^i$$$ where $$$i \ge 1$$$ can be handled individually:
Finally, join the results of the terms together to form the final polynomial. Also, the derivative of the constant term is 0.
For example, the derivative of $$$-3x^3+5x^2-7x+4$$$ is $$$(-3\times 3)x^{3-1}+(5\times 2)x^{2-1}+(7\times 1)x^{1-1}+0$$$ = $$$-9x^2+10x-7$$$
The polynomial's format is similar to the requirements for math homework:
The input consists of a string: the polynomial. The maximum degree of $$$x$$$ is 99 and the coefficients are integers between -99 and 99, including -99 and 99 but excluding 0. The length of the string is at most 100.
It's guaranteed that the string strictly follows the format, i.e. +0x1-1x2+0 is not a possible input.
Output the derivative of the polynomial. It must strictly follow the format.
4x5-x2
20x4-2x
-6x+3
-6
5
0
-3x3+5x2-7x+4
-9x2+10x-7
| Name |
|---|


