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$.)

```python

USER_FILENAME = "<user_code>"
import sys, json, builtins
import math, heapq, bisect, itertools, functools, collections, statistics, fractions, decimal, operator, array, random, re, string, os, pathlib
try:
    import resource as _res
except Exception:
    _res = None
from collections import Counter, defaultdict, deque, OrderedDict
from functools import lru_cache, reduce
from itertools import accumulate, permutations, combinations, product
from math import gcd, ceil, floor, sqrt
from decimal import Decimal
try:
    from typing import *
except Exception:
    pass
try:
    sys.setrecursionlimit(1_000_000)
except Exception:
    pass
try:
    import site as _site
    try:
        _sys_sites = _site.getsitepackages() if hasattr(_site, "getsitepackages") else []
        for _p in _sys_sites:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
    try:
        _usp = _site.getusersitepackages()
        if isinstance(_usp, str):
            _usp = [_usp]
        for _p in _usp:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
except Exception:
    pass

ns = {"__name__": "__main__"}
for _k, _v in list(globals().items()):
    if not _k.startswith("_"):
        ns[_k] = _v
_CODE = "import numpy as np\n'''\ndef findTrace(i,j,k):\n    trace = 0\n    for z in range(0,k+1):\n     trace+=matrix[i+z][j+z]\n    return trace\n'''\n\ndef traceSum(matrix,n):\n sum,round,j = 0,n-1,0\n i = round\n sumArray = []\n \n while (i>=0):\n  while(i<n):\n   sum+=matrix[i][j]\n   i+=1\n   j+=1\n   \n  round-=1\n  i,j = round,0\n  sumArray.append(sum)\n  sum = 0\n  \n round = n-1\n i,j = 0,round\n \n while (j>0):\n  while(j<n):\n   sum += matrix[i][j]\n   i+=1\n   j+=1\n  \n  round-=1\n  i,j = 0,round\n  sumArray.append(sum)\n  sum = 0\n return max(sumArray)\n\n\n \nt = int(input())\nfor i in range(t):\n #Array Size is n\n n = int(input())\n a=[]\n \n for i in range(0,n):\n  ele = list(map(int,input().split()))\n  a.append(ele)\n  \n matrix = np.array(a).reshape(n,n)\n \n #print(matrix)\n '''\n    This worked but had a n^3 complexity and gave an error of time limit \xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0exceeded on submission.\n    trace = 0\n    for i in range(0,n):   #Row number\n     for j in  range(0,n):   #Column number\n      for k in range(0,n):   #Length of Sub-matrix\n       if i+k<n and j+k<n:\n        trace = max(trace,findTrace(i,j,k))  #Check trace of every \xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0sub-matrix & get max\n        '''\n print(traceSum(matrix,n))\n \n"
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

```

Measured memory_bytes: 6170197