A polynomial is a sum of terms, and each term is a constant times a power of a variable. For example, x2−2x+3 is a polynomial. A polynomial in one variable is called a univariate polynomial, and it is usually written like this.
f(x)=anxn+an−1xn−1+⋯+a2x2+a1x+a0
You are given a univariate polynomial of degree at most 1. Write a program that prints the result of differentiating it.