





from __future__ import annotations

import math





def        lowerCamelCase_      (  SCREAMING_SNAKE_CASE__      :			List[Any],			SCREAMING_SNAKE_CASE__      :			List[str]   ) ->	float:
						UpperCAmelCase_			:      str     						=  u
						for i in range(1,			_lowercase   ):
												UpperCAmelCase_			:      str     						=  temp * (u - i)
						return temp





def        lowerCamelCase_      (  ) ->	None:
						UpperCAmelCase_			:      Any     						=  int(input('''enter the numbers of values: '''   )   )
						UpperCAmelCase_			:      list[list[float]]     						=  []
						for _ in range(_lowercase   ):
												y.append([]   )
						for i in range(_lowercase   ):
												for j in range(_lowercase   ):
																		y[i].append(_lowercase   )
																		UpperCAmelCase_			:      List[str]     						=  0

						print('''enter the values of parameters in a list: '''   )
						UpperCAmelCase_			:      Dict     						=  list(map(_lowercase,			input().split()   )   )

						print('''enter the values of corresponding parameters: '''   )
						for i in range(_lowercase   ):
												UpperCAmelCase_			:      Union[str, Any]     						=  float(input()   )

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

						# for calculating forward difference table

						for i in range(1,			_lowercase   ):
												for j in range(n - i   ):
																		UpperCAmelCase_			:      Tuple     						=  y[j + 1][i - 1] - y[j][i - 1]

						UpperCAmelCase_			:      List[str]     						=  y[0][0]
						for i in range(1,			_lowercase   ):
												summ += (ucal(_lowercase,			_lowercase   ) * y[0][i]) / math.factorial(_lowercase   )

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


if __name__ == "__main__":
					main()












'''simple docstring'''







def        lowerCamelCase_      (  SCREAMING_SNAKE_CASE__      :			list[int]   ) ->	list[list[int]]:
						UpperCAmelCase_			:      int     						=  []
						if len(SCREAMING_SNAKE_CASE__   ) == 1:
												return [nums.copy()]
						for _ in range(len(SCREAMING_SNAKE_CASE__   )   ):
												UpperCAmelCase_			:      List[Any]     						=  nums.pop(0   )
												UpperCAmelCase_			:      Optional[Any]     						=  permute(SCREAMING_SNAKE_CASE__   )
												for perm in permutations:
																		perm.append(SCREAMING_SNAKE_CASE__   )
												result.extend(SCREAMING_SNAKE_CASE__   )
												nums.append(SCREAMING_SNAKE_CASE__   )
						return result





def        lowerCamelCase_      (  SCREAMING_SNAKE_CASE__      :			List[str]   ) ->	Any:

						def backtrack(SCREAMING_SNAKE_CASE__      :			Union[str, Any]   ):
												if start == len(SCREAMING_SNAKE_CASE__   ) - 1:
																		output.append(nums[:]   )
												else:
																		for i in range(SCREAMING_SNAKE_CASE__,			len(SCREAMING_SNAKE_CASE__   )   ):
																								UpperCAmelCase_						,       UpperCAmelCase_			:      Tuple     						=  nums[i], nums[start]
																								backtrack(start + 1   )
																								UpperCAmelCase_						,       UpperCAmelCase_			:      int     						=  nums[i], nums[start]  # backtrack

						UpperCAmelCase_			:      Optional[int]     						=  []
						backtrack(0   )
						return output


if __name__ == "__main__":
					import doctest

					# use res to print the data in permute2 function
					snake_case_     :       Tuple						=  permutea([1, 2, 3])
					print(res)
					doctest.testmod()





