9010 - Polynomial Addition   

Description

Given two polynomials please calculate the result of adding these two polynomials.

A = Cnxn + Cn-1xn-1 + ... + C0 

B = C'mxm + C'm-1xm-1 + ... + C'0 

Input

The first line contains an integer t (1 <= t <= 20), which indicates the number of test cases in the input. For each case, the first line contains two integers n, m(n, m <= 1000). Integer n means the highest power of the first polynomial. Integer m means the highest power of the second polynomial. In the next 2 lines, the first line contains n+1 integers, which means the coefficients of the polynomial A from high to low. The second line contains m+1 integers, which means the coefficients of the polynomial B from high to low. All coefficients are less or equal than 105.

Output

For each case, output a line with the coefficients of the polynomial A+B. There is a space between two consecutive numbers.

Sample Input  Download

Sample Output  Download

Tags




Discuss