from collections.abc import Iterator, MutableMapping
from dataclasses import dataclass
from typing import Generic, TypeVar

__lowerCamelCase					:	str       =  TypeVar('''KEY''')
__lowerCamelCase					:	Optional[Any]       =  TypeVar('''VAL''')






@dataclass(frozen=_lowercase    ,		slots=_lowercase					)
class 		a__						(					Generic[KEY, VAL]					):
					A	       =							42
					A	       =							42







class 		a__						(					_Item					):

					def __init__(    self      :       List[str]    ):







							"""simple docstring"""






							super().__init__(UpperCamelCase__,UpperCamelCase__    )






					def __bool__(    self      :       Optional[Any]    ):







							"""simple docstring"""






							return False







__lowerCamelCase					:	List[str]       =  _DeletedItem()






class 		a__						(					MutableMapping[KEY, VAL]					):

					def __init__(    self      :       Any,_A      :       int = 8,_A      :       float = 0.75    ):







							"""simple docstring"""






							SCREAMING_SNAKE_CASE_  :		Optional[Any]				      =    initial_block_size
							SCREAMING_SNAKE_CASE_  :		list[_Item | None]				      =    [None] * initial_block_size
							assert 0.0 < capacity_factor < 1.0
							SCREAMING_SNAKE_CASE_  :		Union[str, Any]				      =    capacity_factor
							SCREAMING_SNAKE_CASE_  :		List[Any]				      =    0

					def 				__UpperCamelCase   (    self      :       Union[str, Any],_A      :       KEY    ):







							"""simple docstring"""






							return hash(UpperCamelCase__    ) % len(self._buckets    )

					def 				__UpperCamelCase   (    self      :       List[str],_A      :       int    ):







							"""simple docstring"""






							return (ind + 1) % len(self._buckets    )

					def 				__UpperCamelCase   (    self      :       List[Any],_A      :       int,_A      :       KEY,_A      :       VAL    ):







							"""simple docstring"""






							SCREAMING_SNAKE_CASE_  :		Any				      =    self._buckets[ind]
							if not stored:
									SCREAMING_SNAKE_CASE_  :		Optional[int]				      =    _Item(UpperCamelCase__,UpperCamelCase__    )
									self._len += 1
									return True
							elif stored.key == key:
									SCREAMING_SNAKE_CASE_  :		Tuple				      =    _Item(UpperCamelCase__,UpperCamelCase__    )
									return True
							else:
									return False

					def 				__UpperCamelCase   (    self      :       Tuple    ):







							"""simple docstring"""






							SCREAMING_SNAKE_CASE_  :		List[Any]				      =    len(self._buckets    ) * self._capacity_factor
							return len(self    ) >= int(UpperCamelCase__    )

					def 				__UpperCamelCase   (    self      :       List[Any]    ):







							"""simple docstring"""






							if len(self._buckets    ) <= self._initial_block_size:
									return False
							SCREAMING_SNAKE_CASE_  :		Optional[int]				      =    len(self._buckets    ) * self._capacity_factor / 2
							return len(self    ) < limit

					def 				__UpperCamelCase   (    self      :       Union[str, Any],_A      :       int    ):







							"""simple docstring"""






							SCREAMING_SNAKE_CASE_  :		Tuple				      =    self._buckets
							SCREAMING_SNAKE_CASE_  :		Union[str, Any]				      =    [None] * new_size
							SCREAMING_SNAKE_CASE_  :		List[Any]				      =    0
							for item in old_buckets:
									if item:
											self._add_item(item.key,item.val    )

					def 				__UpperCamelCase   (    self      :       Optional[Any]    ):







							"""simple docstring"""






							self._resize(len(self._buckets    ) * 2    )

					def 				__UpperCamelCase   (    self      :       Union[str, Any]    ):







							"""simple docstring"""






							self._resize(len(self._buckets    ) // 2    )

					def 				__UpperCamelCase   (    self      :       Any,_A      :       KEY    ):







							"""simple docstring"""






							SCREAMING_SNAKE_CASE_  :		Tuple				      =    self._get_bucket_index(UpperCamelCase__    )
							for _ in range(len(self._buckets    )    ):
									yield ind
									SCREAMING_SNAKE_CASE_  :		int				      =    self._get_next_ind(UpperCamelCase__    )

					def 				__UpperCamelCase   (    self      :       Tuple,_A      :       KEY,_A      :       VAL    ):







							"""simple docstring"""






							for ind in self._iterate_buckets(UpperCamelCase__    ):
									if self._try_set(UpperCamelCase__,UpperCamelCase__,UpperCamelCase__    ):
											break

					def __setitem__(    self      :       Optional[Any],_A      :       KEY,_A      :       VAL    ):







							"""simple docstring"""






							if self._is_full():
									self._size_up()

							self._add_item(UpperCamelCase__,UpperCamelCase__    )

					def __delitem__(    self      :       Tuple,_A      :       KEY    ):







							"""simple docstring"""






							for ind in self._iterate_buckets(UpperCamelCase__    ):
									SCREAMING_SNAKE_CASE_  :		List[Any]				      =    self._buckets[ind]
									if item is None:
											raise KeyError(UpperCamelCase__    )
									if item is _deleted:
											continue
									if item.key == key:
											SCREAMING_SNAKE_CASE_  :		Union[str, Any]				      =    _deleted
											self._len -= 1
											break
							if self._is_sparse():
									self._size_down()

					def __getitem__(    self      :       Dict,_A      :       KEY    ):







							"""simple docstring"""






							for ind in self._iterate_buckets(UpperCamelCase__    ):
									SCREAMING_SNAKE_CASE_  :		Optional[int]				      =    self._buckets[ind]
									if item is None:
											break
									if item is _deleted:
											continue
									if item.key == key:
											return item.val
							raise KeyError(UpperCamelCase__    )

					def __len__(    self      :       str    ):







							"""simple docstring"""






							return self._len

					def __iter__(    self      :       Union[str, Any]    ):







							"""simple docstring"""






							yield from (item.key for item in self._buckets if item)






					def __repr__(    self      :       List[str]    ):







							"""simple docstring"""






							SCREAMING_SNAKE_CASE_  :		Tuple				      =    """ ,""".join(
							    F'{item.key}: {item.val}' for item in self._buckets if item    )
							return F'HashMap({val_string})'








'''simple docstring'''







from collections.abc import Sequence





def  SCREAMING_SNAKE_CASE_       (UpperCamelCase				,			UpperCamelCase      )      ->       float:
							return sum(c * (x**i) for i, c in enumerate(UpperCamelCase      )      )





def  SCREAMING_SNAKE_CASE_       (UpperCamelCase				,			UpperCamelCase      )      ->       float:
							lowerCamelCase__					:	str         =       0.0
							for coeff in reversed(UpperCamelCase      ):
														lowerCamelCase__					:	Optional[int]         =       result * x + coeff
							return result


if __name__ == "__main__":
			_A	:			Any         =(0.0, 0.0, 5.0, 9.3, 7.0)
			_A	:			Optional[Any]         =10.0
			print(evaluate_poly(poly, x))
			print(horner(poly, x))

