Chef is learning linear algebra. Recently, he learnt that for a square matrix $M$, $\mathop{\rm trace}(M)$ is defined as the sum of all elements on the main diagonal of $M$ (an element lies on the main diagonal if its row index and column index are equal).
Now, Chef wants to solve some excercises related to this new quantity, so he wrote down a square matrix $A$ with size $N\times N$. A square submatrix of $A$ with size $l\times l$ is a contiguous block of $l\times l$ elements of $A$. Formally, if $B$ is a submatrix of $A$ with size $l\times l$, then there must be integers $r$ and $c$ ($1\le r, c \le N+1-l$) such that $B_{i,j} = A_{r+i-1, c+j-1}$ for each $1 \le i, j \le l$.
Help Chef find the maximum trace of a square submatrix of $A$.
-----Input-----
- The first line of the input contains a single integer $T$ denoting the number of test cases. The description of $T$ test cases follows.
- The first line of each test case contains a single integer $N$.
- $N$ lines follow. For each $i$ ($1 \le i \le N$), the $i$-th of these lines contains $N$ space-separated integers $A_{i,1}, A_{i,2}, \dots, A_{i, N}$ denoting the $i$-th row of the matrix $A$.
-----Output-----
For each test case, print a single line containing one integer — the maximum possible trace.
-----Constraints-----
- $1 \le T \le 100$
- $2 \le N \le 100$
- $1 \le A_{i,j} \le 100$ for each valid $i, j$
-----Subtasks-----
Subtask #1 (100 points): original constraints
-----Example Input-----
1
3
1 2 5
6 3 4
2 7 1
-----Example Output-----
13
-----Explanation-----
Example case 1: The submatrix with the largest trace is 
6 3
2 7
which has trace equal to $6 + 7 = 13$. (This submatrix is obtained for $r=2, c=1, l=2$.)
# cook your dish here
t = int(input())
while(t):
  t-=1
  n, = list(map(int,input().split()))
  arr =[]
  for i in range(n):
   arr.append([int(x) for x in input().split()])
  for i in range(n-1):
   for j in range(n-1):
    arr[i+1][j+1]+=arr[i][j]
  ans = -float('inf')
  for i in range(n):
   for j in range(n):
    ans=max(ans,arr[i][j])
  print(ans)

# cook your dish here
t = int(input())
while(t):
  t-=1
  n, = list(map(int,input().split()))
  arr =[]
  for i in range(n):
   arr.append([int(x) for x in input().split()])
  for i in range(n-1):
   for j in range(n-1):
    arr[i+1][j+1]+=arr[i][j]
  ans = -float('inf')
  for i in range(n):
   for j in range(n):
    ans=max(ans,arr[i][j])
  print(ans)
