from __future__ import annotations

import math





def 		__lowerCamelCase							(UpperCAmelCase__       :							List[str] ,	UpperCAmelCase__       :							List[Any]					):
					SCREAMING_SNAKE_CASE           =    u
					for i in range(1 ,	__UpperCAmelCase					):
										SCREAMING_SNAKE_CASE           =    temp * (u - i)
					return temp





def 		__lowerCamelCase							():
					SCREAMING_SNAKE_CASE           =    int(input("enter the numbers of values: "					)					)
					SCREAMING_SNAKE_CASE           =    []
					for _ in range(__UpperCAmelCase					):
										y.append([]					)
					for i in range(__UpperCAmelCase					):
										for j in range(__UpperCAmelCase					):
															y[i].append(__UpperCAmelCase					)
															SCREAMING_SNAKE_CASE           =    0

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

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

					SCREAMING_SNAKE_CASE           =    int(input("enter the value to interpolate: "					)					)
					SCREAMING_SNAKE_CASE           =    (value - x[0]) / (x[1] - x[0])

					# for calculating forward difference table

					for i in range(1 ,	__UpperCAmelCase					):
										for j in range(n - i					):
															SCREAMING_SNAKE_CASE           =    y[j + 1][i - 1] - y[j][i - 1]

					SCREAMING_SNAKE_CASE           =    y[0][0]
					for i in range(1 ,	__UpperCAmelCase					):
										summ += (ucal(__UpperCAmelCase ,	__UpperCAmelCase					) * y[0][i]) / math.factorial(__UpperCAmelCase					)

					print(F"the value at {value} is {summ}"					)


if __name__ == "__main__":
					main()





def 		__lowerCamelCase							(UpperCAmelCase__       :							str ,	UpperCAmelCase__       :							str = " "					):
					SCREAMING_SNAKE_CASE           =    []

					SCREAMING_SNAKE_CASE           =    0
					for index, char in enumerate(UpperCAmelCase__					):
										if char == separator:
															split_words.append(string[last_index:index]					)
															SCREAMING_SNAKE_CASE           =    index + 1
										elif index + 1 == len(UpperCAmelCase__					):
															split_words.append(string[last_index : index + 1]					)
					return split_words


if __name__ == "__main__":
							from doctest import testmod

							testmod()




