The first line includes a positive integer T (T<=100) representing the number of test cases.
The second line includes an integer n representing the number of terms of the polynomial.
Then in the next n lines, each line includes the coefficients and exponents of the each term. (0 < n<= 1000, all exponents are in the range [-1000, 1000], all coefficients are in the range [-1000, 1000])
2
2
1 2
2 3
2
1 -2
-2 3
2x+6x^2
-2x^-3-6x^2