



"""simple docstring"""




__UpperCAmelCase	=			[
    [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 					lowerCAmelCase  (   __UpperCamelCase							,      __UpperCamelCase							,      __UpperCamelCase							,      __UpperCamelCase ):
 '''simple docstring'''





 return 0 <= row < rows and 0 <= col < cols
def 					lowerCAmelCase  (   __UpperCamelCase							,      __UpperCamelCase							,      __UpperCamelCase							,      __UpperCamelCase ):
 '''simple docstring'''





 UpperCAmelCase__   :					List[str]   				=   len(__UpperCamelCase )
 UpperCAmelCase__   :					int   				=   len(mat[0] )
 if is_safe(__UpperCamelCase							,      __UpperCamelCase							,      __UpperCamelCase							,      __UpperCamelCase ) and (row, col) not in seen and mat[row][col] == 1:
  seen.add((row, col) )
  return (
      1
      + depth_first_search(row + 1							,      __UpperCamelCase							,      __UpperCamelCase							,      __UpperCamelCase )
      + depth_first_search(row - 1							,      __UpperCamelCase							,      __UpperCamelCase							,      __UpperCamelCase )
      + depth_first_search(__UpperCamelCase							,      col + 1							,      __UpperCamelCase							,      __UpperCamelCase )
      + depth_first_search(__UpperCamelCase							,      col - 1							,      __UpperCamelCase							,      __UpperCamelCase )
  )
 else:
  return 0
def 					lowerCAmelCase  (   __UpperCamelCase ):
 '''simple docstring'''





 UpperCAmelCase__   :					set   				=   set()

 UpperCAmelCase__   :					Dict   				=   0
 for row, line in enumerate(__UpperCamelCase ):
  for col, item in enumerate(__UpperCamelCase ):
   if item == 1 and (row, col) not in seen:
    # Maximizing the area
    UpperCAmelCase__   :					Optional[Any]   				=   max(__UpperCamelCase							,      depth_first_search(__UpperCamelCase							,      __UpperCamelCase							,      __UpperCamelCase							,      __UpperCamelCase ) )
 return max_area


if __name__ == "__main__":
      import doctest

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








"""simple docstring"""




from __future__ import annotations
def 					lowerCAmelCase  (   __UpperCamelCase							,      __UpperCamelCase							,      __UpperCamelCase							,      __UpperCamelCase ):
 '''simple docstring'''





 UpperCAmelCase__				, UpperCAmelCase__   :					Optional[Any]   				=   m - 1, 0
 while i >= 0 and j < n:
  if key == mat[i][j]:
   print(F"Key {key} found at row- {i + 1} column- {j + 1}" )
   return
  if key < mat[i][j]:
   i -= 1
  else:
   j += 1
 print(F"Key {key} not found" )
def 					lowerCAmelCase  (   ):
 '''simple docstring'''





 UpperCAmelCase__   :					Union[str, Any]   				=   [[2, 5, 7], [4, 8, 13], [9, 11, 15], [12, 17, 20]]
 UpperCAmelCase__   :					int   				=   int(input("""Enter the element to be searched:""" ) )
 print(__UpperCamelCase )
 search_in_a_sorted_matrix(__UpperCamelCase							,      len(__UpperCamelCase )							,      len(mat[0] )							,      __UpperCamelCase )


if __name__ == "__main__":
      import doctest

      doctest.testmod()
      main()





