You are teaching a friend the rule for differentiating a polynomial, and no matter how many examples you work through, the rule does not stick. So you decide to write a program that computes the derivative for him.
Differentiating the polynomial
anxn+an−1xn−1+⋯+a2x2+a1x+a0
gives
nanxn−1+(n−1)an−1xn−2+⋯+2a2x+a1
For example, the derivative of 2x3−x+3 is 6x2−1, and the derivative of 3x4+2x3+7x2+5x+7 is 12x3+6x2+14x+5.
Given a polynomial, print its derivative. Only polynomials of the form shown above appear in this problem.
The first line contains the number of test cases.
Each test case is given on a single line. The first integer on the line is the highest exponent n (1≤n≤100) of the polynomial, followed by n+1 coefficients, one for each term from xn down to x0. Every coefficient is an integer between −1000 and 1000, inclusive. The highest exponent is always positive. All numbers are separated by a single space.
Print one line for each test case. The line starts with Case x:, where x is the test case number counting from 1. Put a single space after the colon and then write the derivative.
Write the derivative in the same format as the input. The first value is the highest exponent n−1 of the derivative, followed by its n coefficients from xn−1 down to x0. Separate the values with a single space, and print the leading coefficient even when it is 0.