'''simple docstring'''




from __future__ import annotations

import math

def _UpperCamelCase   (       SCREAMING_SNAKE_CASE_  ,       SCREAMING_SNAKE_CASE_							):
     lowercase_					:       Optional[int]     				=					u
     for i in range(1  ,       SCREAMING_SNAKE_CASE_							):
          lowercase_					:       Any     				=					temp * (u - i)
     return temp

def _UpperCamelCase   (       ):
     lowercase_					:       Dict     				=					int(input('enter the numbers of values: '							)							)
     lowercase_					:       list[list[float]]     				=					[]
     for _ in range(SCREAMING_SNAKE_CASE_							):
          y.append([]							)
     for i in range(SCREAMING_SNAKE_CASE_							):
          for j in range(SCREAMING_SNAKE_CASE_							):
               y[i].append(SCREAMING_SNAKE_CASE_							)
               lowercase_					:       str     				=					0

     print('enter the values of parameters in a list: '							)
     lowercase_					:       Any     				=					list(map(SCREAMING_SNAKE_CASE_  ,       input().split()							)							)

     print('enter the values of corresponding parameters: '							)
     for i in range(SCREAMING_SNAKE_CASE_							):
          lowercase_					:       List[str]     				=					float(input()							)

     lowercase_					:       Dict     				=					int(input('enter the value to interpolate: '							)							)
     lowercase_					:       Any     				=					(value - x[0]) / (x[1] - x[0])

     # for calculating forward difference table

     for i in range(1  ,       SCREAMING_SNAKE_CASE_							):
          for j in range(n - i							):
               lowercase_					:       Optional[Any]     				=					y[j + 1][i - 1] - y[j][i - 1]

     lowercase_					:       Union[str, Any]     				=					y[0][0]
     for i in range(1  ,       SCREAMING_SNAKE_CASE_							):
          summ += (ucal(SCREAMING_SNAKE_CASE_  ,       SCREAMING_SNAKE_CASE_							) * y[0][i]) / math.factorial(SCREAMING_SNAKE_CASE_							)

     print(f'''the value at {value} is {summ}'''							)


if __name__ == "__main__":
 main()





'''simple docstring'''




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

def _UpperCamelCase   (       SCREAMING_SNAKE_CASE_							):

     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'							)

     lowercase_					:       str     				=					precision
     lowercase_					:       List[str]     				=					ceil(precision / 14							)
     lowercase_					:       Union[str, Any]     				=					426_880 * Decimal(10_005							).sqrt()
     lowercase_					:       List[Any]     				=					1
     lowercase_					:       Optional[int]     				=					13_591_409
     lowercase_					:       Dict     				=					Decimal(SCREAMING_SNAKE_CASE_							)
     for k in range(1  ,       SCREAMING_SNAKE_CASE_							):
          lowercase_					:       List[str]     				=					factorial(6 * k							) // (factorial(3 * k							) * factorial(SCREAMING_SNAKE_CASE_							) ** 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__":
 _A								=   5_0
 print(F"""The first {n} digits of pi is: {pi(n)}""")




