Input to this problem will begin with a line containing a single integer n indicating the number of input polynomials. Each of the following n lines contain:
- a value of x at which the first derivative of the polynomial is to be evaluated;
- and the polynomial.
All polynomials are expressed in terms of x, with single-digit integer coefficients (positive or negative) and non-negative single-digit integer powers of x. Polynomials do not contain spaces. Coefficients and powers of 1 (and powers of 0) are omitted from the notation, as is any "+" sign that might apply to the leading term. The leading term has the highest order, and is followed by the one (if any) with the next-highest order and so on.