Given amatrix mat of size N x N. The task is to print the elements of the matrix in the snake pattern.
First line consists of an integer T denoting the number of test cases. First line of each test case consists of N, denoting number of elements(N x N) in Matrix. Second line of every test case consists of N x N spaced integers denoting elements of Matrix elements.
For each testcase, in a new line, print the matrix in snake pattern.
1 <= T <= 100
1 <= N <= 100
1 <= mat[i][j] <= 100