Determine if a table of numbers containing ~N~ rows and ~N~ columns is a magic square.
A ~N\times N~ table of numbers ~(1 \le N \le 50)~ is a magic square if and only the sum of the numbers along any row or column is constant. The diagonals are not required to have the same sum.
The first line of input contains an integer ~T~ ~(1 \le T \le 10)~, the
number of test cases to follow.
Each test case starts with an integer ~N~ ~(1 \le N \le 50)~, which is followed by ~N^2~ integers, each on its own line - the entries of the table, in reading order. This means that the first ~N~ integers represent the first row of the table, from left to right, the next ~N~ integers the second row likewise, and so on. There is a blank line between each pair of adjacent cases.
For each test case, print
yes if it is a magic square, and
no if it
3 2 1 2 2 1 1 5 2 1 2 3 4
yes yes no