


‘GRID[i][j]’ = 0, if there is no building at cell (i, j).
Consider the following 2*2 ‘GRID[][]’:
[1, 2]
[3, 4]
Its projection in XY, YZ, XZ plane is shown below -:

Area covered in XY plane is 4, Area covered in YZ plane is 6, Area covered in ZX plane is 7, Thus the total area is 4 + 6 + 7 = 17.
The first line contains a single integer ‘T’ representing the number of test cases.
The first line of each test case will contain a single integer ‘N’, representing the dimensions of ‘GRID’
The next ‘N’ line of each test case will follow, each contains ‘N’ space-separated integers. These ‘N’ lines together represent the matrix ‘GRID[][]’.
For each test case, print a single integer that represents the total area of projections in the XY, YZ, and ZX plane.
Output for every test case will be printed in a separate line.
You don’t need to print anything; it has already been taken care of. Just implement the given function.
1 <= T <= 50
2 <= N <= 1000
0 <= GRID[i][j] <= 100
Where ‘GRID[i][j]’ is the height of the building at cell (i, j).
Time limit: 1 sec
In the XY plane, the shadow made by each building will be 1 square.
In the YZ plane, the shadow made will be the largest value for each row in the grid.
In the ZX plane, the shadow made will be the largest value for each column in the grid.
The steps are as follows: