Did you know that today, March 12th, is National Plant a Flower Day?
Lale, a dedicated gardener, just found out and is now ready to plant exactly one flower — after all, it's not "Plant Many Flowers Day!" Her newest garden, a rectangular field, is guaranteed to have space to plant. Additionally, she wants to find the perfect spot to plant the flower and make her garden look its best. Specifically, she's aiming to capture the most powerful photo of her garden.
Lale photographs her garden by either choosing $$$x$$$ consecutive rows or $$$x$$$ consecutive columns. The "power" of this photo will then be $$$x$$$ (i.e. the number of rows or columns selected). However, if the photo contains at least one cell without a flower (i.e. a $$$0$$$ in the sub-grid), the power is automatically reduced to $$$0$$$.
Given a description of her garden, help Lale figure out the most powerful photo she can take if she can plant another flower!
The first line contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n, m$$$ and $$$n \cdot m \leq 10^5$$$)
The next $$$n$$$ lines contain $$$m$$$ integers, where each integer is either $$$0$$$ (an empty cell) or $$$1$$$ (a flower). It is guaranteed at least one empty cell is in the garden.
Output a single integer — the power of the most powerful photo full of flowers Lale can take after planting exactly one flower.
3 30 1 11 1 10 0 0
2
3 40 1 1 10 1 0 01 1 1 0
2
2 20 00 0
0
In the first sample, Lale can plant a flower in the top left, allowing her to take a picture of the first two rows full of flowers.
In the second sample, Lale can plant a flower in the 2nd row and 3rd column, allowing her to take a picture of the middle two columns.
In the third sample, no matter where she plants a flower, Lale cannot guarantee at least one row or column full of flowers.