

from collections.abc import Iterable
from typing import Generic, TypeVar

_UpperCAmelCase	:						int			=     TypeVar("_T")




class    __lowerCAmelCase       (							Generic[_T]):






       def __init__(   self:					Tuple       ,					_lowerCAmelCase:					Iterable[_T] | None = None				):
         lowercase    :list[_T]      	=						list(iterable or []				)
         lowercase    :list[_T]      	=						[]






       def __len__(   self:					Dict				):
         return len(self._stacka				) + len(self._stacka				)






       def __repr__(   self:					Optional[int]				):
         return F"Queue({tuple(self._stacka[::-1] + self._stacka				)})"






       def 					SCREAMING_SNAKE_CASE    (   self:					Any       ,					_lowerCAmelCase:					_T				):
         self._stacka.append(_lowerCAmelCase				)






       def 					SCREAMING_SNAKE_CASE    (   self:					List[str]				):
         lowercase    :Tuple      	=						self._stacka.pop
         lowercase    :Optional[int]      	=						self._stacka.append

         if not self._stacka:
           while self._stacka:
             stacka_append(stacka_pop()				)

         if not self._stacka:
           raise IndexError("Queue is empty"				)
         return self._stacka.pop()


if __name__ == "__main__":
     from doctest import testmod

     testmod()









def       UpperCAmelCase__  (     lowerCamelCase   ):
  return 10 - x * x



def       UpperCAmelCase__  (     lowerCamelCase,			lowerCamelCase   ):
  # Bolzano theory in order to find if there is a root between a and b
  if equation(lowerCamelCase   ) * equation(lowerCamelCase   ) >= 0:
    raise ValueError("Wrong space!"   )

  lowercase    :Optional[int]      	=						a
  while (b - a) >= 0.01:
    # Find middle point
    lowercase    :Optional[Any]      	=						(a + b) / 2
    # Check if middle point is root
    if equation(lowerCamelCase   ) == 0.0:
      break
    # Decide the side to repeat the steps
    if equation(lowerCamelCase   ) * equation(lowerCamelCase   ) < 0:
      lowercase    :Any      	=						c
    else:
      lowercase    :List[Any]      	=						c
  return c


if __name__ == "__main__":
     import doctest

     doctest.testmod()

     print(bisection(-2, 5))
     print(bisection(0, 6))



