






"""simple docstring"""







import math
from collections.abc import Generator





def 						lowercase__(A						)				->Generator[int, None, None]:




						"""simple docstring"""



						lowercase__				:      int=       (i for i in range(1					,		(max_n + 1)						))
						for i in (n for n in numbers if n > 1):
												for j in range(2					,		_SCREAMING_SNAKE_CASE						):
																		if (i % j) == 0:
																								break
												else:
																		yield i





def 						lowercase__(A						)				->Generator[int, None, None]:




						"""simple docstring"""



						lowercase__				:      Union[str, Any]=       (i for i in range(1					,		(max_n + 1)						))
						for i in (n for n in numbers if n > 1):
												# only need to check for factors up to sqrt(i)
												lowercase__				:      Optional[int]=       int(math.sqrt(_SCREAMING_SNAKE_CASE						)						) + 1
												for j in range(2					,		_SCREAMING_SNAKE_CASE						):
																		if (i % j) == 0:
																								break
												else:
																		yield i





def 						lowercase__(A						)				->Generator[int, None, None]:




						"""simple docstring"""



						lowercase__				:      Dict=       (i for i in range(1					,		(max_n + 1)					,		2						))
						# It's useless to test even numbers as they will not be prime
						if max_n > 2:
												yield 2  # Because 2 will not be tested, it's necessary to yield it now
						for i in (n for n in numbers if n > 1):
												lowercase__				:      List[Any]=       int(math.sqrt(_SCREAMING_SNAKE_CASE						)						) + 1
												for j in range(3					,		_SCREAMING_SNAKE_CASE					,		2						):
																		# As we removed the even numbers, we don't need them now
																		if (i % j) == 0:
																								break
												else:
																		yield i





def 						lowercase__()				->Union[str, Any]:




						"""simple docstring"""



						from timeit import timeit

						lowercase__				:      List[str]=       "from __main__ import slow_primes, primes, fast_primes"
						print(timeit("slow_primes(1_000_000_000_000)"					,		setup=_SCREAMING_SNAKE_CASE					,		number=1_000_000						)						)
						print(timeit("primes(1_000_000_000_000)"					,		setup=_SCREAMING_SNAKE_CASE					,		number=1_000_000						)						)
						print(timeit("fast_primes(1_000_000_000_000)"					,		setup=_SCREAMING_SNAKE_CASE					,		number=1_000_000						)						)


if __name__ == "__main__":
			a :				Tuple      					=		int(input("""Calculate primes up to:\n>> """).strip())
			for ret in primes(number):
						print(ret)
			benchmark()











'''simple docstring'''

from __future__ import annotations

from pathlib import Path






def 		_snake_case		(					_SCREAMING_SNAKE_CASE     :						tuple[int, int]							,		_SCREAMING_SNAKE_CASE     :						tuple[int, int]							)			->						int:







	"""simple docstring"""
	return pointa[0] * pointa[1] - pointa[1] * pointa[0]






def 		_snake_case		(					_SCREAMING_SNAKE_CASE     :						int							,		_SCREAMING_SNAKE_CASE     :						int							,		_SCREAMING_SNAKE_CASE     :						int							,		_SCREAMING_SNAKE_CASE     :						int							,		_SCREAMING_SNAKE_CASE     :						int							,		_SCREAMING_SNAKE_CASE     :						int							)			->						bool:







	"""simple docstring"""
	lowerCAmelCase    =	(xa, ya)
	lowerCAmelCase    =	(xa - xa, ya - ya)
	lowerCAmelCase    =	(xa - xa, ya - ya)
	lowerCAmelCase    =	-vector_product(_SCREAMING_SNAKE_CASE							,		_SCREAMING_SNAKE_CASE							) / vector_product(
	    _SCREAMING_SNAKE_CASE							,		_SCREAMING_SNAKE_CASE							)
	lowerCAmelCase    =	+vector_product(_SCREAMING_SNAKE_CASE							,		_SCREAMING_SNAKE_CASE							) / vector_product(
	    _SCREAMING_SNAKE_CASE							,		_SCREAMING_SNAKE_CASE							)

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






def 		_snake_case		(					_SCREAMING_SNAKE_CASE     :						str = "p102_triangles.txt"							)			->						int:







	"""simple docstring"""
	lowerCAmelCase    =	Path(_SCREAMING_SNAKE_CASE							).parent.joinpath(_SCREAMING_SNAKE_CASE							).read_text(encoding="""utf-8"""							)

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

	lowerCAmelCase    =	0
	lowerCAmelCase    =	42

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

	return ret


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