


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

def 	_a     ( SCREAMING_SNAKE_CASE		: Any   ):







 """simple docstring"""



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

 UpperCamelCase__    :			Tuple      				=      precision
 UpperCamelCase__    :			Union[str, Any]      				=      ceil(precision / 14   )
 UpperCamelCase__    :			Tuple      				=      426880 * Decimal(10005   ).sqrt()
 UpperCamelCase__    :			int      				=      1
 UpperCamelCase__    :			int      				=      13591409
 UpperCamelCase__    :			List[Any]      				=      Decimal(SCREAMING_SNAKE_CASE   )
 for k in range(1			,       SCREAMING_SNAKE_CASE   ):
  UpperCamelCase__    :			str      				=      factorial(6 * k   ) // (factorial(3 * k   ) * factorial(SCREAMING_SNAKE_CASE   ) ** 3)
  linear_term += 545140134
  exponential_term *= -262537412640768000
  partial_sum += Decimal(multinomial_term * linear_term   ) / exponential_term
 return str(constant_term / partial_sum   )[:-1]


if __name__ == "__main__":
       __UpperCamelCase				:				List[Any]  				= 50
       print(f"The first {n} digits of pi is: {pi(n)}")



'''simple docstring'''

def 			__UpperCamelCase       (   UpperCAmelCase = 1		,     UpperCAmelCase = 1000     ):
 lowercase__				:    Dict  =					1
 lowercase__				:    Dict  =					0

 for divide_by_number in range(UpperCAmelCase		,     digit + 1     ):
  lowercase__				:    list[int]  =					[]
  lowercase__				:    Union[str, Any]  =					numerator
  for _ in range(1		,     digit + 1     ):
   if now_divide in has_been_divided:
    if longest_list_length < len(UpperCAmelCase     ):
     lowercase__				:    Dict  =					len(UpperCAmelCase     )
     lowercase__				:    Optional[Any]  =					divide_by_number
   else:
    has_been_divided.append(UpperCAmelCase     )
    lowercase__				:    int  =					now_divide * 10 % divide_by_number

 return the_digit


# Tests
if __name__ == "__main__":
  import doctest

  doctest.testmod()

