You are given a grid of size \(N * M\) where N and M denotes the number of rows and columns respectively. Each cell of the grid is filled with some number.
Now, We define a quantity called Magic Number for each row and column as the maximum number of consecutive adjacent elements having the same number. Now the password of the entry gate is the defined as the \(MAX\) of \(M_R\)[i]\( \)*\( M_C\)[j]\( \) where \(M_R\)[i] and \(M_C\)[j]\( \) refers to Magic number of \(i^{th}\) row and \(j^{th}\) column respectively.
Can you find the password ?
Input:
First line containts T denoting number of test cases. For each of the test case, the first line contains N and M. After that N lines having M integers are provided.
Output:
For each test case, output the value of password in a separate line.
Constraints:
\( 1 \le T \le 5 \)
\(1 \le N,M \le 1000\)
\( 1 \le A[i] \le 100 \)