






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

__snake_case												=  TypeVar("""KEY""")
__snake_case												=  TypeVar("""VAL""")







@dataclass(frozen=lowercase_,	slots=lowercase_ )
class 			UpperCAmelCase_						(					Generic[KEY, VAL] ):



      """simple docstring"""
      UpperCamelCase_				:					List[Any]           =42
      UpperCamelCase_				:					str           =42







class 			UpperCAmelCase_						(					_Item ):



      """simple docstring"""
      def __init__(				self )				->      List[str]:
          super().__init__(SCREAMING_SNAKE_CASE_    ,				SCREAMING_SNAKE_CASE_ )




      def __bool__(				self )				->      Optional[int]:
          return False







__snake_case												=  _DeletedItem()







class 			UpperCAmelCase_						(					MutableMapping[KEY, VAL] ):



      """simple docstring"""
      def __init__(				self    ,				SCREAMING_SNAKE_CASE_ = 8    ,				SCREAMING_SNAKE_CASE_ = 0.75 )				->      int:
          UpperCamelCase       :Optional[Any]								=   initial_block_size
          UpperCamelCase       :list[_Item | None]								=   [None] * initial_block_size
          assert 0.0 < capacity_factor < 1.0
          UpperCamelCase       :Union[str, Any]								=   capacity_factor
          UpperCamelCase       :Tuple								=   0
      def     UpperCAmelCase						(				self    ,				SCREAMING_SNAKE_CASE_ )				->      Optional[int]:
          return hash(SCREAMING_SNAKE_CASE_ ) % len(self._buckets )
      def     UpperCAmelCase						(				self    ,				SCREAMING_SNAKE_CASE_ )				->      str:
          return (ind + 1) % len(self._buckets )
      def     UpperCAmelCase						(				self    ,				SCREAMING_SNAKE_CASE_    ,				SCREAMING_SNAKE_CASE_    ,				SCREAMING_SNAKE_CASE_ )				->      Any:
          UpperCamelCase       :Dict								=   self._buckets[ind]
          if not stored:
              UpperCamelCase       :List[Any]								=   _Item(SCREAMING_SNAKE_CASE_    ,				SCREAMING_SNAKE_CASE_ )
              self._len += 1
              return True
          elif stored.key == key:
              UpperCamelCase       :List[str]								=   _Item(SCREAMING_SNAKE_CASE_    ,				SCREAMING_SNAKE_CASE_ )
              return True
          else:
              return False
      def     UpperCAmelCase						(				self )				->      Dict:
          UpperCamelCase       :int								=   len(self._buckets ) * self._capacity_factor
          return len(self ) >= int(SCREAMING_SNAKE_CASE_ )
      def     UpperCAmelCase						(				self )				->      Dict:
          if len(self._buckets ) <= self._initial_block_size:
              return False
          UpperCamelCase       :str								=   len(self._buckets ) * self._capacity_factor / 2
          return len(self ) < limit
      def     UpperCAmelCase						(				self    ,				SCREAMING_SNAKE_CASE_ )				->      Tuple:
          UpperCamelCase       :int								=   self._buckets
          UpperCamelCase       :int								=   [None] * new_size
          UpperCamelCase       :Optional[Any]								=   0
          for item in old_buckets:
              if item:
                  self._add_item(item.key    ,				item.val )
      def     UpperCAmelCase						(				self )				->      str:
          self._resize(len(self._buckets ) * 2 )
      def     UpperCAmelCase						(				self )				->      Union[str, Any]:
          self._resize(len(self._buckets ) // 2 )
      def     UpperCAmelCase						(				self    ,				SCREAMING_SNAKE_CASE_ )				->      str:
          UpperCamelCase       :Union[str, Any]								=   self._get_bucket_index(SCREAMING_SNAKE_CASE_ )
          for _ in range(len(self._buckets ) ):
              yield ind
              UpperCamelCase       :Dict								=   self._get_next_ind(SCREAMING_SNAKE_CASE_ )
      def     UpperCAmelCase						(				self    ,				SCREAMING_SNAKE_CASE_    ,				SCREAMING_SNAKE_CASE_ )				->      Tuple:
          for ind in self._iterate_buckets(SCREAMING_SNAKE_CASE_ ):
              if self._try_set(SCREAMING_SNAKE_CASE_    ,				SCREAMING_SNAKE_CASE_    ,				SCREAMING_SNAKE_CASE_ ):
                  break
      def __setitem__(				self    ,				SCREAMING_SNAKE_CASE_    ,				SCREAMING_SNAKE_CASE_ )				->      List[str]:
          if self._is_full():
              self._size_up()

          self._add_item(SCREAMING_SNAKE_CASE_    ,				SCREAMING_SNAKE_CASE_ )
      def __delitem__(				self    ,				SCREAMING_SNAKE_CASE_ )				->      Optional[Any]:
          for ind in self._iterate_buckets(SCREAMING_SNAKE_CASE_ ):
              UpperCamelCase       :Dict								=   self._buckets[ind]
              if item is None:
                  raise KeyError(SCREAMING_SNAKE_CASE_ )
              if item is _deleted:
                  continue
              if item.key == key:
                  UpperCamelCase       :Optional[Any]								=   _deleted
                  self._len -= 1
                  break
          if self._is_sparse():
              self._size_down()
      def __getitem__(				self    ,				SCREAMING_SNAKE_CASE_ )				->      int:
          for ind in self._iterate_buckets(SCREAMING_SNAKE_CASE_ ):
              UpperCamelCase       :int								=   self._buckets[ind]
              if item is None:
                  break
              if item is _deleted:
                  continue
              if item.key == key:
                  return item.val
          raise KeyError(SCREAMING_SNAKE_CASE_ )
      def __len__(				self )				->      int:
          return self._len
      def __iter__(				self )				->      Dict:
          yield from (item.key for item in self._buckets if item)




      def __repr__(				self )				->      Optional[Any]:
          UpperCamelCase       :Optional[Any]								=   ' ,'.join(
              F'''{item.key}: {item.val}''' for item in self._buckets if item )
          return F'''HashMap({val_string})'''










"""simple docstring"""







def 				UpperCamelCase_    (    lowerCAmelCase__      :				int = 100						)						->   int:

  """simple docstring"""




  lowerCAmelCase_   :				Any								= (n * (n + 1) // 2) ** 2
  lowerCAmelCase_   :				Optional[int]								= n * (n + 1) * (2 * n + 1) // 6
  return sum_cubes - sum_squares


if __name__ == "__main__":
     print(f'{solution() = }')





