





def 			lowerCamelCase_		(					lowerCAmelCase:		Optional[int]			,							lowerCAmelCase:		Optional[int]			,							lowerCAmelCase:		int			,							lowerCAmelCase:		List[Any] )->						int:
  if start == end:
    return start if lst[start] > item else start + 1
  if start > end:
    return start

  _snake_case      : Any														=		(start + end) // 2
  if lst[mid] < item:
    return binary_search(lowerCAmelCase			,							lowerCAmelCase			,							mid + 1			,							lowerCAmelCase )
  elif lst[mid] > item:
    return binary_search(lowerCAmelCase			,							lowerCAmelCase			,							lowerCAmelCase			,							mid - 1 )
  else:
    return mid


def 			lowerCamelCase_		(					lowerCAmelCase:		Tuple )->						Tuple:
  _snake_case      : Optional[Any]														=		len(lowerCAmelCase )

  for index in range(1			,							lowerCAmelCase ):
    _snake_case      : int														=		lst[index]
    _snake_case      : Tuple														=		binary_search(lowerCAmelCase			,							lowerCAmelCase			,							0			,							index - 1 )
    _snake_case      : List[str]														=		lst[:pos] + [value] + lst[pos:index] + lst[index + 1 :]

  return lst


def 			lowerCamelCase_		(					lowerCAmelCase:		Union[str, Any]			,							lowerCAmelCase:		List[Any] )->						Optional[int]:
  if not left:
    return right

  if not right:
    return left

  if left[0] < right[0]:
    return [left[0], *merge(left[1:]			,							lowerCAmelCase )]

  return [right[0], *merge(lowerCAmelCase			,							right[1:] )]


def 			lowerCamelCase_		(					lowerCAmelCase:		Any )->						Dict:
  _snake_case      : Tuple														=		len(lowerCAmelCase )
  _snake_case							,    _snake_case      : int														=		[], []
  _snake_case      : Any														=		[lst[0]]
  _snake_case      : Optional[int]														=		[]
  _snake_case      : int														=		1
  while i < length:
    if lst[i] < lst[i - 1]:
      runs.append(lowerCAmelCase )
      _snake_case      : Any														=		[lst[i]]
    else:
      new_run.append(lst[i] )
    i += 1
  runs.append(lowerCAmelCase )

  for run in runs:
    sorted_runs.append(insertion_sort(lowerCAmelCase ) )
  for run in sorted_runs:
    _snake_case      : Optional[Any]														=		merge(lowerCAmelCase			,							lowerCAmelCase )

  return sorted_array


def 			lowerCamelCase_		(					)->						List[Any]:
  _snake_case      : Dict														=		[5, 9, 10, 3, -4, 5, 1_78, 92, 46, -18, 0, 7]
  _snake_case      : Optional[int]														=		tim_sort(lowerCAmelCase )
  print(lowerCAmelCase )


if __name__ == "__main__":
      main()









from __future__ import annotations

from pathlib import Path







def 				A			(		__UpperCAmelCase							,					__UpperCAmelCase	)       ->       int:



						'''simple docstring'''






						return pointa[0] * pointa[1] - pointa[1] * pointa[0]







def 				A			(		__UpperCAmelCase							,					__UpperCAmelCase							,					__UpperCAmelCase							,					__UpperCAmelCase							,					__UpperCAmelCase							,					__UpperCAmelCase	)       ->       bool:



						'''simple docstring'''






						UpperCAmelCase_     							=     (xa, ya)
						UpperCAmelCase_     							=     (xa - xa, ya - ya)
						UpperCAmelCase_     							=     (xa - xa, ya - ya)
						UpperCAmelCase_     							=     -vector_product(__UpperCAmelCase							,					__UpperCAmelCase	) / vector_product(
						    __UpperCAmelCase							,					__UpperCAmelCase	)
						UpperCAmelCase_     							=     +vector_product(__UpperCAmelCase							,					__UpperCAmelCase	) / vector_product(
						    __UpperCAmelCase							,					__UpperCAmelCase	)

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







def 				A			(		__UpperCAmelCase = "p102_triangles.txt"	)       ->       int:



						'''simple docstring'''






						UpperCAmelCase_     							=     Path(__UpperCAmelCase	).parent.joinpath(__UpperCAmelCase	).read_text(encoding='''utf-8'''	)

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

						UpperCAmelCase_     							=     0
						UpperCAmelCase_     							=     42

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

						return ret


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





