"""simple docstring"""







import math


def      __lowerCAmelCase(		__UpperCAmelCase			):






	"""simple docstring"""





	_lowercase :    Union[str, Any]							=							[True] * n
	_lowercase :    str							=							False
	_lowercase :    Tuple							=							False
	_lowercase :    List[str]							=							True

	for i in range(3     ,int(n**0.5 + 1			)     ,2			):
		_lowercase :    Any							=							i * 2
		while index < n:
			_lowercase :    Union[str, Any]							=							False
			_lowercase :    Dict							=							index + i

	_lowercase :    int							=							[2]

	for i in range(3     ,__UpperCAmelCase     ,2			):
		if is_prime[i]:
			primes.append(__UpperCAmelCase			)

	return primes


def      __lowerCAmelCase(		__UpperCAmelCase = 999_966_663_333			):






	"""simple docstring"""





	_lowercase :    Optional[int]							=							math.floor(math.sqrt(__UpperCAmelCase			)			) + 100
	_lowercase :    Union[str, Any]							=							prime_sieve(__UpperCAmelCase			)

	_lowercase :    Optional[Any]							=							0
	_lowercase :    Union[str, Any]							=							0
	_lowercase :    int							=							primes[prime_index]

	while (last_prime**2) <= limit:
		_lowercase :    Optional[int]							=							primes[prime_index + 1]

		_lowercase :    Optional[Any]							=							last_prime**2
		_lowercase :    Dict							=							next_prime**2

		# Get numbers divisible by lps(current)
		_lowercase :    Optional[int]							=							lower_bound + last_prime
		while upper_bound > current <= limit:
			matches_sum += current
			current += last_prime

		# Reset the upper_bound
		while (upper_bound - next_prime) > limit:
			upper_bound -= next_prime

		# Add the numbers divisible by ups(current)
		_lowercase :    Any							=							upper_bound - next_prime
		while current > lower_bound:
			matches_sum += current
			current -= next_prime

		# Remove the numbers divisible by both ups and lps
		_lowercase :    Any							=							0
		while upper_bound > current <= limit:
			if current <= lower_bound:
				# Increment the current number
				current += last_prime * next_prime
				continue

			if current > limit:
				break

			# Remove twice since it was added by both ups and lps
			matches_sum -= current * 2

			# Increment the current number
			current += last_prime * next_prime

		# Setup for next pair
		_lowercase :    List[str]							=							next_prime
		prime_index += 1

	return matches_sum


if __name__ == "__main__":
						print(solution())




"""simple docstring"""







from decimal import Decimal, getcontext
from math import ceil, factorial


def      __lowerCAmelCase(		__UpperCAmelCase			):






	"""simple docstring"""





	if not isinstance(__UpperCAmelCase     ,__UpperCAmelCase			):
		raise TypeError('Undefined for non-integers'			)
	elif precision < 1:
		raise ValueError('Undefined for non-natural numbers'			)

	_lowercase :    Optional[Any]							=							precision
	_lowercase :    Dict							=							ceil(precision / 14			)
	_lowercase :    int							=							426_880 * Decimal(10_005			).sqrt()
	_lowercase :    Optional[Any]							=							1
	_lowercase :    Union[str, Any]							=							13_591_409
	_lowercase :    Optional[int]							=							Decimal(__UpperCAmelCase			)
	for k in range(1     ,__UpperCAmelCase			):
		_lowercase :    List[str]							=							factorial(6 * k			) // (factorial(3 * k			) * factorial(__UpperCAmelCase			) ** 3)
		linear_term += 545_140_134
		exponential_term *= -262_537_412_640_768_000
		partial_sum += Decimal(multinomial_term * linear_term			) / exponential_term
	return str(constant_term / partial_sum			)[:-1]


if __name__ == "__main__":
						SCREAMING_SNAKE_CASE									=						50
						print(f"""The first {n} digits of pi is: {pi(n)}""")



