
"""simple docstring"""







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

lowerCamelCase__           =	TypeVar("""KEY""")
lowerCamelCase__           =	TypeVar("""VAL""")




@dataclass(frozen=UpperCamelCase_ ,  slots=UpperCamelCase_)
class 				A__ (			Generic[KEY, VAL]):
		A_		: KEY
		A_		: VAL




class 				A__ (			_Item):

		def __init__(   self				):
			super().__init__(_a ,	_a				)







		def __bool__(   self				):
			return False



lowerCamelCase__           =	_DeletedItem()




class 				A__ (			MutableMapping[KEY, VAL]):

		def __init__(   self ,	_SCREAMING_SNAKE_CASE = 8 ,	_SCREAMING_SNAKE_CASE = 0.75				):
			__lowerCAmelCase    :		List[Any]		    =   initial_block_size
			__lowerCAmelCase    :		list[_Item | None]		    =   [None] * initial_block_size
			assert 0.0 < capacity_factor < 1.0
			__lowerCAmelCase    :		Optional[int]		    =   capacity_factor
			__lowerCAmelCase    :		Any		    =   0

		def 							__lowerCamelCase							(   self ,	_SCREAMING_SNAKE_CASE				):
			return hash(_a				) % len(self._buckets				)

		def 							__lowerCamelCase							(   self ,	_SCREAMING_SNAKE_CASE				):
			return (ind + 1) % len(self._buckets				)

		def 							__lowerCamelCase							(   self ,	_SCREAMING_SNAKE_CASE ,	_SCREAMING_SNAKE_CASE ,	_SCREAMING_SNAKE_CASE				):
			__lowerCAmelCase    :		List[Any]		    =   self._buckets[ind]
			if not stored:
				__lowerCAmelCase    :		str		    =   _Item(_a ,	_a				)
				self._len += 1
				return True
			elif stored.key == key:
				__lowerCAmelCase    :		Union[str, Any]		    =   _Item(_a ,	_a				)
				return True
			else:
				return False

		def 							__lowerCamelCase							(   self				):
			__lowerCAmelCase    :		List[str]		    =   len(self._buckets				) * self._capacity_factor
			return len(self				) >= int(_a				)

		def 							__lowerCamelCase							(   self				):


			if len(self._buckets				) <= self._initial_block_size:
				return False
			__lowerCAmelCase    :		List[Any]		    =   len(self._buckets				) * self._capacity_factor / 2
			return len(self				) < limit

		def 							__lowerCamelCase							(   self ,	_SCREAMING_SNAKE_CASE				):
			__lowerCAmelCase    :		Dict		    =   self._buckets
			__lowerCAmelCase    :		Tuple		    =   [None] * new_size
			__lowerCAmelCase    :		Any		    =   0
			for item in old_buckets:
				if item:
					self._add_item(item.key ,	item.val				)

		def 							__lowerCamelCase							(   self				):
			self._resize(len(self._buckets				) * 2				)

		def 							__lowerCamelCase							(   self				):
			self._resize(len(self._buckets				) // 2				)

		def 							__lowerCamelCase							(   self ,	_SCREAMING_SNAKE_CASE				):
			__lowerCAmelCase    :		str		    =   self._get_bucket_index(_a				)
			for _ in range(len(self._buckets				)				):
				yield ind
				__lowerCAmelCase    :		List[str]		    =   self._get_next_ind(_a				)

		def 							__lowerCamelCase							(   self ,	_SCREAMING_SNAKE_CASE ,	_SCREAMING_SNAKE_CASE				):


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

		def __setitem__(   self ,	_SCREAMING_SNAKE_CASE ,	_SCREAMING_SNAKE_CASE				):


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

			self._add_item(_a ,	_a				)

		def __delitem__(   self ,	_SCREAMING_SNAKE_CASE				):


			for ind in self._iterate_buckets(_a				):
				__lowerCAmelCase    :		Dict		    =   self._buckets[ind]
				if item is None:
					raise KeyError(_a				)
				if item is _deleted:
					continue
				if item.key == key:
					__lowerCAmelCase    :		List[Any]		    =   _deleted
					self._len -= 1
					break
			if self._is_sparse():
				self._size_down()

		def __getitem__(   self ,	_SCREAMING_SNAKE_CASE				):


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

		def __len__(   self				):
			return self._len

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







		def __repr__(   self				):
			__lowerCAmelCase    :		int		    =   """ ,""".join(
			    f"{item.key}: {item.val}" for item in self._buckets if item				)
			return f"HashMap({val_string})"

"""simple docstring"""







def 					__lowerCAmelCase       (_UpperCamelCase ,						_UpperCamelCase	):

	if density <= 0:
		raise ValueError('Impossible fluid density'	)
	if bulk_modulus <= 0:
		raise ValueError('Impossible bulk modulus'	)

	return (bulk_modulus / density) ** 0.5


if __name__ == "__main__":
							import doctest

							doctest.testmod()