


"""simple docstring"""






A_			  =    [
    [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			):
   return 0 <= row < rows and 0 <= col < cols




def 						_UpperCamelCase			(  A    ,       A    ,       A    ,       A			):
   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			):
   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"""






from __future__ import annotations

from pathlib import Path




def 						_UpperCamelCase			(  A    ,       A			):
   return pointa[0] * pointa[1] - pointa[1] * pointa[0]




def 						_UpperCamelCase			(  A    ,       A    ,       A    ,       A    ,       A    ,       A			):
   UpperCamelCase_     =(xa, ya)
   UpperCamelCase_     =(xa - xa, ya - ya)
   UpperCamelCase_     =(xa - xa, ya - ya)
   UpperCamelCase_     =-vector_product(A    ,       A			) / vector_product(
       A    ,       A			)
   UpperCamelCase_     =+vector_product(A    ,       A			) / vector_product(
       A    ,       A			)

   return a > 0 and b > 0 and a + b < 1




def 						_UpperCamelCase			(  A = "p102_triangles.txt"			):
   UpperCamelCase_     =Path(A			).parent.joinpath(A			).read_text(encoding="utf-8"			)

   UpperCamelCase_     =[]
   for line in data.strip().split("\n"			):
      triangles.append([int(A			) for number in line.split(","			)]			)

   UpperCamelCase_     =0
   UpperCamelCase_     =42

   for triangle in triangles:
      ret += contains_origin(*A			)

   return ret


if __name__ == "__main__":
    print(f'''{solution() = }''')
