You are given a grid of R rows and C columns where every cell is 0 or 1. Consider every axis-aligned square block of cells. Find the area (number of cells) of the largest such square whose cells are all 1. If the grid has no 1, the answer is 0.
Input format
Line 1: two integers R and C.
Next R lines: each has C space-separated values, every value 0 or 1.
Output format
A single integer: the area of the largest all-ones square.
Constraints
- 1 <= R, C <= 400
- each cell is 0 or 1