






from __future__ import annotations

from pathlib import Path







def   snake_case		(				UpperCAmelCase						:							tuple[int, int],    UpperCAmelCase						:							tuple[int, int] ):
				return pointa[0] * pointa[1] - pointa[1] * pointa[0]







def   snake_case		(				UpperCAmelCase						:							int,    UpperCAmelCase						:							int,    UpperCAmelCase						:							int,    UpperCAmelCase						:							int,    UpperCAmelCase						:							int,    UpperCAmelCase						:							int ):
				A									=   (xa, ya)
				A									=   (xa - xa, ya - ya)
				A									=   (xa - xa, ya - ya)
				A									=   -vector_product(UpperCAmelCase,    UpperCAmelCase ) / vector_product(
				    UpperCAmelCase,    UpperCAmelCase )
				A									=   +vector_product(UpperCAmelCase,    UpperCAmelCase ) / vector_product(
				    UpperCAmelCase,    UpperCAmelCase )

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







def   snake_case		(				UpperCAmelCase						:							str = "p102_triangles.txt" ):
				A									=   Path(UpperCAmelCase ).parent.joinpath(UpperCAmelCase ).read_text(encoding='utf-8' )

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

				A									=   0
				A									=   42

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

				return ret


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













from __future__ import annotations







def   snake_case		(				UpperCAmelCase						:							int,    UpperCAmelCase						:							list[int],    UpperCAmelCase						:							list[int],    UpperCAmelCase						:							int ):

				# Base Case
				if counter == 0 or capacity == 0:
								return 0

				# If weight of the nth item is more than Knapsack of capacity,
				#   then this item cannot be included in the optimal solution,
				# else return the maximum of two cases:
				#   (1) nth item included
				#   (2) not included
				if weights[counter - 1] > capacity:
								return knapsack(UpperCAmelCase,    UpperCAmelCase,    UpperCAmelCase,    counter - 1 )
				else:
								A									=   capacity - weights[counter - 1]
								A									=   values[counter - 1] + knapsack(
								    UpperCAmelCase,    UpperCAmelCase,    UpperCAmelCase,    counter - 1 )
								A									=   knapsack(UpperCAmelCase,    UpperCAmelCase,    UpperCAmelCase,    counter - 1 )
								return max(UpperCAmelCase,    UpperCAmelCase )


if __name__ == "__main__":
					import doctest

					doctest.testmod()





