(He who has already studied linear algebra may skip this part) A matrix is composed of n × n elements. Formally, is an n × n matrix. For example, A= Two operations on matrices will be used in this problem: and an1 an2 ··· ann () a11 a12 ··· a1n a21 a22 ··· a2n A= . . ... . is a 2×2 matrix.
0 0 0 0 3 4 A= It can be proven that there are infinitely many solutions, however, I do not like trivial answer, so your answer must have at least (n ∗ n)/2 non-zero elements. Input The first line contains the number of tests t (1 ≤ t ≤ 15). Each case contains two lines. The first line contains an integer m (1 ≤ m ≤ 30). The second line contains m integers, representing k1, k2, . . . , km respectively. Absolute values of the integers are no greater than 100. Output For each test case, if no answer can be found, print ‘-1’. Otherwise print n, indicating that you found an n × n matrix root. The following n lines should be the matrix. It is guaranteed that if there is an answer, the smallest possible n is not greater than 50, so your n should also NOT be greater than 50. The absolute value of integers you gave should not be larger than 1000. Sample Input 2 2 1 -5 2 1 -5
10565 – Matrix 3/3 Sample Output 2 14 23 2 14 23