

"""simple docstring"""





from __future__ import annotations

import math

def     __SCREAMING_SNAKE_CASE    ( A_		,	A_					):
	lowerCAmelCase__      :		List[Any]    							=      u
	for i in range(1		,	A_					):
		lowerCAmelCase__      :		Union[str, Any]    							=      temp * (u - i)
	return temp

def     __SCREAMING_SNAKE_CASE    ( ):
	lowerCAmelCase__      :		Optional[int]    							=      int(input('''enter the numbers of values: '''					)					)
	lowerCAmelCase__      :		list[list[float]]    							=      []
	for _ in range(A_					):
		y.append([]					)
	for i in range(A_					):
		for j in range(A_					):
			y[i].append(A_					)
			lowerCAmelCase__      :		Optional[int]    							=      0

	print('''enter the values of parameters in a list: '''					)
	lowerCAmelCase__      :		int    							=      list(map(A_		,	input().split()					)					)

	print('''enter the values of corresponding parameters: '''					)
	for i in range(A_					):
		lowerCAmelCase__      :		Dict    							=      float(input()					)

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

	# for calculating forward difference table

	for i in range(1		,	A_					):
		for j in range(n - i					):
			lowerCAmelCase__      :		List[Any]    							=      y[j + 1][i - 1] - y[j][i - 1]

	lowerCAmelCase__      :		str    							=      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"""





def     __SCREAMING_SNAKE_CASE    ( A_					):
	for i in range(len(A_					) - 1		,	0		,	-1					):
		lowerCAmelCase__      :		Optional[Any]    							=      False

		for j in range(A_		,	0		,	-1					):
			if unsorted[j] < unsorted[j - 1]:
				lowerCAmelCase__							,lowerCAmelCase__      :		Union[str, Any]    							=      unsorted[j - 1], unsorted[j]
				lowerCAmelCase__      :		Dict    							=      True

		for j in range(A_					):
			if unsorted[j] > unsorted[j + 1]:
				lowerCAmelCase__							,lowerCAmelCase__      :		Union[str, Any]    							=      unsorted[j + 1], unsorted[j]
				lowerCAmelCase__      :		Any    							=      True

		if not swapped:
			break
	return unsorted


if __name__ == "__main__":
							import doctest

							doctest.testmod()
							__UpperCamelCase    : int				 =						input('''Enter numbers separated by a comma:\n''').strip()
							__UpperCamelCase    : Optional[Any]				 =						[int(item) for item in user_input.split(''',''')]
							print(F'''{cocktail_shaker_sort(unsorted) = }''')




