"""simple docstring"""







def      __lowerCAmelCase(		__UpperCAmelCase = 10**12			):






	"""simple docstring"""





	_lowercase :    Dict							=							1
	_lowercase :    Union[str, Any]							=							0

	_lowercase :    Optional[Any]							=							1
	_lowercase :    Any							=							1

	while numerator <= 2 * min_total - 1:
		prev_numerator += 2 * numerator
		numerator += 2 * prev_numerator

		prev_denominator += 2 * denominator
		denominator += 2 * prev_denominator

	return (denominator + 1) // 2


if __name__ == "__main__":
						print(f"""{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)}""")



