





from __future__ import annotations

import math






def 				_UpperCAmelCase			(    A				,							A     ):




   '''simple docstring'''

   UpperCAmelCase__						=u
   for i in range(1				,							_SCREAMING_SNAKE_CASE     ):
      UpperCAmelCase__						=temp * (u - i)
   return temp






def 				_UpperCAmelCase			(    ):




   '''simple docstring'''

   UpperCAmelCase__						=int(input("enter the numbers of values: "     )     )
   UpperCAmelCase__						=[]
   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     )
         UpperCAmelCase__						=0

   print("enter the values of parameters in a list: "     )
   UpperCAmelCase__						=list(map(_SCREAMING_SNAKE_CASE				,							input().split()     )     )

   print("enter the values of corresponding parameters: "     )
   for i in range(_SCREAMING_SNAKE_CASE     ):
      UpperCAmelCase__						=float(input()     )

   UpperCAmelCase__						=int(input("enter the value to interpolate: "     )     )
   UpperCAmelCase__						=(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     ):
         UpperCAmelCase__						=y[j + 1][i - 1] - y[j][i - 1]

   UpperCAmelCase__						=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'''





def 						UpperCAmelCase__(				_SCREAMING_SNAKE_CASE					: int,_SCREAMING_SNAKE_CASE					: int,_SCREAMING_SNAKE_CASE					: int ):






			"""simple docstring"""




			if exponent == 1:
						return base
			if exponent % 2 == 0:
						__A=	_modexpt(_SCREAMING_SNAKE_CASE,exponent // 2,_SCREAMING_SNAKE_CASE ) % modulo_value
						return (x * x) % modulo_value
			else:
						return (base * _modexpt(_SCREAMING_SNAKE_CASE,exponent - 1,_SCREAMING_SNAKE_CASE )) % modulo_value






def 						UpperCAmelCase__(				_SCREAMING_SNAKE_CASE					: int = 1777,_SCREAMING_SNAKE_CASE					: int = 1855,_SCREAMING_SNAKE_CASE					: int = 8 ):






			"""simple docstring"""




			__A=	base
			for _ in range(1,_SCREAMING_SNAKE_CASE ):
						__A=	_modexpt(_SCREAMING_SNAKE_CASE,_SCREAMING_SNAKE_CASE,10**digits )

			return result


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



