


'''simple docstring'''







a__    :   Union[str, Any]								=			[
    [0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0],
    [0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0],
    [0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0],
    [0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0],
]







def _UpperCamelCase			(	__A ,     __A ,     __A ,     __A       )				->						bool:


      '''simple docstring'''



      return 0 <= row < rows and 0 <= col < cols







def _UpperCamelCase			(	__A ,     __A ,     __A ,     __A       )				->						int:


      '''simple docstring'''



      UpperCamelCase__      =							len(__A       )
      UpperCamelCase__      =							len(mat[0]       )
      if is_safe(__A ,     __A ,     __A ,     __A       ) and (row, col) not in seen and mat[row][col] == 1:
            seen.add((row, col)       )
            return (
                1
                + depth_first_search(row + 1 ,     __A ,     __A ,     __A       )
                + depth_first_search(row - 1 ,     __A ,     __A ,     __A       )
                + depth_first_search(__A ,     col + 1 ,     __A ,     __A       )
                + depth_first_search(__A ,     col - 1 ,     __A ,     __A       )
            )
      else:
            return 0







def _UpperCamelCase			(	__A       )				->						int:


      '''simple docstring'''



      UpperCamelCase__      =							set()

      UpperCamelCase__      =							0
      for row, line in enumerate(__A       ):
            for col, item in enumerate(__A       ):
                  if item == 1 and (row, col) not in seen:
                        # Maximizing the area
                        UpperCamelCase__      =							max(__A ,     depth_first_search(__A ,     __A ,     __A ,     __A       )       )
      return max_area


if __name__ == "__main__":
  import doctest

  print(find_max_area(matrix))  # Output -> 6
  doctest.testmod()









'''simple docstring'''







import itertools







def _UpperCamelCase			(	__A = 1000000       )				->						int:


      '''simple docstring'''



      UpperCamelCase__      =							[1]

      for i in itertools.count(len(__A       )       ):
            UpperCamelCase__      =							0
            for j in itertools.count(1       ):
                  UpperCamelCase__      =							-1 if j % 2 == 0 else +1
                  UpperCamelCase__      =							(j * j * 3 - j) // 2
                  if index > i:
                        break
                  item += partitions[i - index] * sign
                  item %= number
                  index += j
                  if index > i:
                        break
                  item += partitions[i - index] * sign
                  item %= number

            if item == 0:
                  return i
            partitions.append(__A       )

      return 0


if __name__ == "__main__":
  import doctest

  doctest.testmod()

  print(F"""{solution() = }""")





