#C8234. Largest Zero Square
Largest Zero Square
Largest Zero Square
You are given an \(n \times m\) grid of integers. Your task is to find the side length of the largest square sub-grid that contains only zeros. The grid may contain positive, negative, and zero values. If there is no zero in the grid, the answer is \(0\).
Consider every possible square in the grid, and determine the largest one where all elements are zero.
inputFormat
The first line of input contains two integers \(n\) and \(m\), representing the number of rows and columns, respectively.
Each of the following \(n\) lines contains \(m\) space-separated integers, representing the grid.
outputFormat
Output a single integer representing the side length of the largest square sub-grid that consists entirely of zeros.
## sample5 5
1 0 0 0 -2
2 0 0 0 -3
3 0 0 0 0
-1 0 0 0 1
-2 0 -3 0 -4
3
</p>