Math Tutoring

No attempts yetTime limit1sMemory limit128 MB

Problem

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+an1xn1++a2x2+a1x+a0a_n x^n + a_{n-1} x^{n-1} + \dots + a_2 x^2 + a_1 x + a_0

gives

nanxn1+(n1)an1xn2++2a2x+a1n a_n x^{n-1} + (n-1) a_{n-1} x^{n-2} + \dots + 2 a_2 x + a_1

For example, the derivative of 2x3x+32x^3 - x + 3 is 6x216x^2 - 1, and the derivative of 3x4+2x3+7x2+5x+73x^4 + 2x^3 + 7x^2 + 5x + 7 is 12x3+6x2+14x+512x^3 + 6x^2 + 14x + 5.

Given a polynomial, print its derivative. Only polynomials of the form shown above appear in this problem.

Input

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 nn (1n1001 \le n \le 100) of the polynomial, followed by n+1n+1 coefficients, one for each term from xnx^n down to x0x^0. Every coefficient is an integer between 1000-1000 and 10001000, inclusive. The highest exponent is always positive. All numbers are separated by a single space.

Output

Print one line for each test case. The line starts with Case x:, where xx 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 n1n-1 of the derivative, followed by its nn coefficients from xn1x^{n-1} down to x0x^0. Separate the values with a single space, and print the leading coefficient even when it is 0.