

from __future__ import annotations

from pathlib import Path



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



def  __lowerCAmelCase (  A    ,       A    ,       A    ,       A    ,       A    ,       A      ):
	UpperCAmelCase_    			=     (xa, ya)
	UpperCAmelCase_    			=     (xa - xa, ya - ya)
	UpperCAmelCase_    			=     (xa - xa, ya - ya)
	UpperCAmelCase_    			=     -vector_product(_lowerCAmelCase    ,       _lowerCAmelCase      ) / vector_product(
	    _lowerCAmelCase    ,       _lowerCAmelCase      )
	UpperCAmelCase_    			=     +vector_product(_lowerCAmelCase    ,       _lowerCAmelCase      ) / vector_product(
	    _lowerCAmelCase    ,       _lowerCAmelCase      )

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



def  __lowerCAmelCase (  A = "p102_triangles.txt"      ):
	UpperCAmelCase_    			=     Path(_lowerCAmelCase      ).parent.joinpath(_lowerCAmelCase      ).read_text(encoding="utf-8"      )

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

	UpperCAmelCase_    			=     0
	UpperCAmelCase_    			=     42

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

	return ret


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


def  __lowerCAmelCase (  A      ):
	UpperCAmelCase_    			=     len(A      )

	# Set the gap value to be decreased by a factor of 1.3
	# after each iteration
	UpperCAmelCase_    			=     1.3

	# Continue sorting until the gap is 1
	while gap > 1:
		# Decrease the gap value
		UpperCAmelCase_    			=     int(gap / shrink      )

		# Sort the elements using insertion sort
		for i in range(A    ,       len(A      )      ):
			UpperCAmelCase_    			=     collection[i]
			UpperCAmelCase_    			=     i
			while j >= gap and collection[j - gap] > temp:
				UpperCAmelCase_    			=     collection[j - gap]
				j -= gap
			UpperCAmelCase_    			=     temp

	return collection


if __name__ == "__main__":
				import doctest

				doctest.testmod()