


'''simple docstring'''
from __future__ import annotations

import math


def     a   (    __a				,      __a     )						->			float:



					'''simple docstring'''






					UpperCamelCase__     :List[str]							      =				u
					for i in range(1				,      __a     ):
										UpperCamelCase__     :Tuple							      =				temp * (u - i)
					return temp


def     a   (    )						->			None:



					'''simple docstring'''






					UpperCamelCase__     :Optional[Any]							      =				int(input('''enter the numbers of values: '''     )     )
					UpperCamelCase__     :list[list[float]]							      =				[]
					for _ in range(__a     ):
										y.append([]     )
					for i in range(__a     ):
										for j in range(__a     ):
															y[i].append(__a     )
															UpperCamelCase__     :List[Any]							      =				0

					print('''enter the values of parameters in a list: '''     )
					UpperCamelCase__     :List[str]							      =				list(map(__a				,      input().split()     )     )

					print('''enter the values of corresponding parameters: '''     )
					for i in range(__a     ):
										UpperCamelCase__     :int							      =				float(input()     )

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

					# for calculating forward difference table

					for i in range(1				,      __a     ):
										for j in range(n - i     ):
															UpperCamelCase__     :Union[str, Any]							      =				y[j + 1][i - 1] - y[j][i - 1]

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

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


if __name__ == "__main__":
		main()



'''simple docstring'''
import numpy as np


def     a   (    __a				,      __a				,      __a				,      __a				,      __a     )						->			Union[str, Any]:



					'''simple docstring'''






					UpperCamelCase__     :Tuple							      =				int(np.ceil((x_end - xa) / h     )     )
					UpperCamelCase__     :Optional[int]							      =				np.zeros((n + 1,)     )
					UpperCamelCase__     :List[str]							      =				ya
					UpperCamelCase__     :Tuple							      =				xa

					for k in range(__a     ):
										UpperCamelCase__     :Dict							      =				f(__a				,      y[k]     )
										UpperCamelCase__     :List[Any]							      =				f(x + 0.5 * h				,      y[k] + 0.5 * h * ka     )
										UpperCamelCase__     :Dict							      =				f(x + 0.5 * h				,      y[k] + 0.5 * h * ka     )
										UpperCamelCase__     :List[Any]							      =				f(x + h				,      y[k] + h * ka     )
										UpperCamelCase__     :List[str]							      =				y[k] + (1 / 6) * h * (ka + 2 * ka + 2 * ka + ka)
										x += h

					return y


if __name__ == "__main__":
		import doctest

		doctest.testmod()