When the former Big Brother Brazil contestant Davi Brito dropped the phrase "Calma, Calabreso", the internet did what it always does: it turned the moment into an endless stream of edits, reactions, and inside jokes. The meme became so big that it even inspired a Davi Brito lookalike contest at UFBA, which awarded a "kit calabresa" (lá ele!) prize.
To celebrate the chaos, his fans assembled a "calabreso panel" from screenshots, reactions, captions, and meme fragments arranged in a matrix. Each cell stores an integer representing the type of content placed in that position.
A rectangular part of the panel is calm if it still looks exactly the same after a rotation of $$$180^\circ$$$. In other words, if you rotate the rectangle by half a turn, every cell must match the cell that moves into its place. So the top-left corner must match the bottom-right corner, the top-right corner must match the bottom-left corner, and so on.
Some parts of the panel are almost symmetric, but not quite. Others are perfectly balanced, as if even the meme itself had decided to calm down.
Your task is to find the maximum possible area of a calm submatrix.
Formally, a submatrix defined by corners $$$(i_1, j_1)$$$ and $$$(i_2, j_2)$$$ is calm if $$$$$$ A_{i, j} = A_{i_1 + i_2 - i, j_1 + j_2 - j} $$$$$$ for every cell $$$(i, j)$$$ inside the submatrix.
The first line contains two integers $$$N$$$ and $$$M$$$ ($$$1 \leq N \leq 200$$$, $$$1 \leq M \leq 200$$$).
Each of the next $$$N$$$ lines contains $$$M$$$ integers, describing the matrix $$$A$$$ ($$$1 \leq A_{i, j} \leq 10^{4}$$$).
Output a single integer: the largest possible area of a calm submatrix.
3 31 2 34 5 43 2 1
9
3 41 7 7 12 8 9 25 6 6 5
4
2 31 2 34 5 6
1
Explanation for example 1
The whole matrix is valid. After a $$$180^\circ$$$ rotation, each cell matches the one in the opposite position, so the answer is $$$3 \times 3 = 9$$$.
Explanation for example 2
One can choose the first row of the matrix, which has an area of $$$4$$$. An alternative is the last row, which also has an area of $$$4$$$.