






'''simple docstring'''





from __future__ import annotations

from pathlib import Path






def        lowerCamelCase__   (					__lowerCamelCase    :  tuple[int, int]						,	__lowerCamelCase    :  tuple[int, int]	):
  return pointa[0] * pointa[1] - pointa[1] * pointa[0]






def        lowerCamelCase__   (					__lowerCamelCase    :  int						,	__lowerCamelCase    :  int						,	__lowerCamelCase    :  int						,	__lowerCamelCase    :  int						,	__lowerCamelCase    :  int						,	__lowerCamelCase    :  int	):
  __UpperCAmelCase							:			tuple[int, int]     =						(xa, ya)
  __UpperCAmelCase							:			tuple[int, int]     =						(xa - xa, ya - ya)
  __UpperCAmelCase							:			tuple[int, int]     =						(xa - xa, ya - ya)
  __UpperCAmelCase							:			float     =						-vector_product(__lowerCamelCase						,	__lowerCamelCase	) / vector_product(
      __lowerCamelCase						,	__lowerCamelCase	)
  __UpperCAmelCase							:			float     =						+vector_product(__lowerCamelCase						,	__lowerCamelCase	) / vector_product(
      __lowerCamelCase						,	__lowerCamelCase	)

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






def        lowerCamelCase__   (					__lowerCamelCase    :  str = "p102_triangles.txt"	):
  __UpperCAmelCase							:			str     =						Path(__lowerCamelCase	).parent.joinpath(__lowerCamelCase	).read_text(encoding="""utf-8"""	)

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

  __UpperCAmelCase							:			int     =						0
  __UpperCAmelCase							:			list[int]

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

  return ret


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










a	: List[str]      =				[[0, 1, 1], [0, 0, 1], [1, 0, 0]]
class 					a					:



      """simple docstring"""


      def __init__(   self      :    Union[str, Any]	,   __lowercase      :    List[str]      )							->   Optional[int]:
        __UpperCAmelCase							:			Dict     =						name
        __UpperCAmelCase							:			Optional[Any]     =						[]
        __UpperCAmelCase							:			List[Any]     =						[]
      def 			UpperCAmelCase   (   self      :    str	,   __lowercase      :    int      )							->   str:
        self.inbound.append(__lowercase      )
      def 			UpperCAmelCase   (   self      :    List[Any]	,   __lowercase      :    Optional[Any]      )							->   List[str]:
        self.outbound.append(__lowercase      )




      def __repr__(   self      :    Any      )							->   int:
        return f"""<node={self.name} inbound={self.inbound} outbound={self.outbound}>"""






def        lowerCamelCase__   (					__lowerCamelCase    :  Dict						,	__lowerCamelCase    :  str=3						,	__lowerCamelCase    :  int=0.8_5	):
  __UpperCAmelCase							:			Optional[int]     =						{}
  for node in nodes:
    __UpperCAmelCase							:			str     =						1

  __UpperCAmelCase							:			Union[str, Any]     =						{}
  for node in nodes:
    __UpperCAmelCase							:			Dict     =						len(node.outbound	)

  for i in range(__lowerCamelCase	):
    print(f"""======= Iteration {i + 1} ======="""	)
    for _, node in enumerate(__lowerCamelCase	):
      __UpperCAmelCase							:			int     =						(1 - d) + d * sum(
          ranks[ib] / outbounds[ib] for ib in node.inbound	)
    print(__lowerCamelCase	)






def        lowerCamelCase__   (					):
  __UpperCAmelCase							:			Optional[Any]     =						list(input("""Enter Names of the Nodes: """	).split()	)

  __UpperCAmelCase							:			Dict     =						[Node(__lowerCamelCase	) for name in names]

  for ri, row in enumerate(__lowerCamelCase	):
    for ci, col in enumerate(__lowerCamelCase	):
      if col == 1:
        nodes[ci].add_inbound(names[ri]	)
        nodes[ri].add_outbound(names[ci]	)

  print("""======= Nodes ======="""	)
  for node in nodes:
    print(__lowerCamelCase	)

  page_rank(__lowerCamelCase	)


if __name__ == "__main__":
       main()


