



from collections.abc import Sequence






def      _A				(UpperCamelCase		:      Sequence[float]      ,			UpperCamelCase		:      float )  ->float:



			'''simple docstring'''







			return sum(c * (x**i) for i, c in enumerate(UpperCamelCase ) )






def      _A				(UpperCamelCase		:      Sequence[float]      ,			UpperCamelCase		:      float )  ->float:



			'''simple docstring'''







			lowerCamelCase__ :      List[Any]								=		0.0
			for coeff in reversed(UpperCamelCase ):
						lowerCamelCase__ :      int								=		result * x + coeff
			return result


if __name__ == "__main__":
				_lowercase     							=						(0.0, 0.0, 5.0, 9.3, 7.0)
				_lowercase     							=						10.0
				print(evaluate_poly(poly, x))
				print(horner(poly, x))








def      _A				(UpperCamelCase		:      List[Any]      ,			UpperCamelCase		:      Dict )  ->List[str]:



			'''simple docstring'''







			lowerCamelCase__ :      int								=		[1]
			for i in range(2      ,			UpperCamelCase ):
						factorials.append(factorials[-1] * i )
			assert 0 <= k < factorials[-1] * n, "k out of bounds"

			lowerCamelCase__ :      Union[str, Any]								=		[]
			lowerCamelCase__ :      Optional[Any]								=		list(range(UpperCamelCase ) )

			# Find permutation
			while factorials:
						lowerCamelCase__ :      Union[str, Any]								=		factorials.pop()
						lowerCamelCase__							,lowerCamelCase__ :      Union[str, Any]								=		divmod(UpperCamelCase      ,			UpperCamelCase )
						permutation.append(elements[number] )
						elements.remove(elements[number] )
			permutation.append(elements[0] )

			return permutation


if __name__ == "__main__":
				import doctest

				doctest.testmod()



