output_description: Print the area (the number of 0s) of the largest square.
input_description: H W
      c1,1 c1,2 ... c1,W
      c2,1 c2,2 ... c2,W
      :
      cH,1 cH,2 ... cH,W
      
  
  In the first line, two integers H and W separated by a space character are
  given. In the following H lines, ci,j, elements of the H × W matrix, are
  given.
attempt: import sys
  
  
  def solve():
      file_input = sys.stdin
      H, W = map(int, file_input.readline().split())
      side_length = 0
      prev = [0] * (W + 1)
      for line in file_input:
          tile_line = map(int, line.split())
          current = [0] * (W + 1)
          for i, tpl in enumerate(zip(tile_line, prev, prev[1:]), start=1):
              t, p1, p2 = tpl
              if t:
                  current[i] = 0
              else:
                  current[i] = min(p1, p2, current[i - 1]) + 1
          prev = current
          side_length = max(side_length, max(current))
      print(side_length**2)
  
  
  solve()
  
problem_description: Largest Square
  
  Given a matrix (H × W) which contains only 1 and 0, find the area of the
  largest square matrix which only contains 0s.
samples: [{"input": "5\n    0 0 1 0 0\n    1 0 0 0 0\n    0 0 0 1 0\n    0 0 0 1 0", "output": "4"}]