from math import isclose, sqrt







def     _a				(      lowercase__  :			float     ,  lowercase__  :			float     ,  lowercase__  :			float ):







     '''simple docstring'''


     SCREAMING_SNAKE_CASE__				:				Tuple			=		point_y / 4 / point_x
     SCREAMING_SNAKE_CASE__				:				Tuple			=		2 * normal_gradient / (1 + normal_gradient * normal_gradient)
     SCREAMING_SNAKE_CASE__				:				List[str]			=		(1 - normal_gradient * normal_gradient) / (
         1 + normal_gradient * normal_gradient
     )
     SCREAMING_SNAKE_CASE__				:				int			=		(sa - ca * incoming_gradient) / (ca + sa * incoming_gradient)

     # to find the next point, solve the simultaeneous equations:
     # y^2 + 4x^2 = 100
     # y - b = m * (x - a)
     # ==> A x^2 + B x + C = 0
     SCREAMING_SNAKE_CASE__				:				Optional[int]			=		outgoing_gradient**2 + 4
     SCREAMING_SNAKE_CASE__				:				Any			=		2 * outgoing_gradient * (point_y - outgoing_gradient * point_x)
     SCREAMING_SNAKE_CASE__				:				List[str]			=		(point_y - outgoing_gradient * point_x) ** 2 - 1_00

     SCREAMING_SNAKE_CASE__				:				Tuple			=		(
         -linear_term - sqrt(linear_term**2 - 4 * quadratic_term * constant_term )
     ) / (2 * quadratic_term)
     SCREAMING_SNAKE_CASE__				:				int			=		(
         -linear_term + sqrt(linear_term**2 - 4 * quadratic_term * constant_term )
     ) / (2 * quadratic_term)

     # two solutions, one of which is our input point
     SCREAMING_SNAKE_CASE__				:				List[Any]			=		x_minus if isclose(lowercase__     ,  lowercase__ ) else x_plus
     SCREAMING_SNAKE_CASE__				:				List[str]			=		point_y + outgoing_gradient * (next_x - point_x)

     return next_x, next_y, outgoing_gradient







def     _a				(      lowercase__  :			float = 1.4     ,  lowercase__  :			float = -9.6 ):







     '''simple docstring'''


     SCREAMING_SNAKE_CASE__				:				int			=		0
     SCREAMING_SNAKE_CASE__				:				float			=		first_x_coord
     SCREAMING_SNAKE_CASE__				:				float			=		first_y_coord
     SCREAMING_SNAKE_CASE__				:				float			=		(10.1 - point_y) / (0.0 - point_x)

     while not (-0.01 <= point_x <= 0.01 and point_y > 0):
          SCREAMING_SNAKE_CASE__			,							SCREAMING_SNAKE_CASE__			,							SCREAMING_SNAKE_CASE__				:				Dict			=		next_point(lowercase__     ,  lowercase__     ,  lowercase__ )
          num_reflections += 1

     return num_reflections


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




class       snake_case					(      UpperCamelCase_						):
  pass




class       snake_case					(      UpperCamelCase_						):
  pass




class       snake_case					:




  def __init__(      self     :	Union[str, Any]				)->       Tuple:




       """simple docstring"""
       SCREAMING_SNAKE_CASE__				:				int			=		[
           [],
           [],
           [],
       ]




  def 	__lowercase(      self     :	int     , a_     :	int     , a_     :	int				)->       None:




       """simple docstring"""
       try:
            if len(self.queues[priority]				) >= 100:
                 raise OverflowError('Maximum queue size is 100'				)
            self.queues[priority].append(a_				)
       except IndexError:
            raise ValueError('Valid priorities are 0, 1, and 2'				)




  def 	__lowercase(      self     :	int				)->       int:




       """simple docstring"""
       for queue in self.queues:
            if queue:
                 return queue.pop(0				)
       raise UnderFlowError('All queues are empty'				)




  def __str__(      self     :	Any				)->       str:




       """simple docstring"""
       return "\n".join(F'''Priority {i}: {q}''' for i, q in enumerate(self.queues				)				)




class       snake_case					:




  def __init__(      self     :	Union[str, Any]				)->       Dict:




       """simple docstring"""
       SCREAMING_SNAKE_CASE__				:				List[Any]			=		[]




  def 	__lowercase(      self     :	List[str]     , a_     :	int				)->       None:




       """simple docstring"""
       if len(self.queue				) == 100:
            raise OverFlowError('Maximum queue size is 100'				)
       self.queue.append(a_				)




  def 	__lowercase(      self     :	int				)->       int:




       """simple docstring"""
       if not self.queue:
            raise UnderFlowError('The queue is empty'				)
       else:
            SCREAMING_SNAKE_CASE__				:				Optional[int]			=		min(self.queue				)
            self.queue.remove(a_				)
            return data




  def __str__(      self     :	List[str]				)->       str:




       """simple docstring"""
       return str(self.queue				)







def     _a				(      ):







     '''simple docstring'''


     SCREAMING_SNAKE_CASE__				:				int			=		FixedPriorityQueue()
     fpq.enqueue(0     ,  10 )
     fpq.enqueue(1     ,  70 )
     fpq.enqueue(0     ,  1_00 )
     fpq.enqueue(2     ,  1 )
     fpq.enqueue(2     ,  5 )
     fpq.enqueue(1     ,  7 )
     fpq.enqueue(2     ,  4 )
     fpq.enqueue(1     ,  64 )
     fpq.enqueue(0     ,  1_28 )
     print(lowercase__ )
     print(fpq.dequeue() )
     print(fpq.dequeue() )
     print(fpq.dequeue() )
     print(fpq.dequeue() )
     print(fpq.dequeue() )
     print(lowercase__ )
     print(fpq.dequeue() )
     print(fpq.dequeue() )
     print(fpq.dequeue() )
     print(fpq.dequeue() )
     print(fpq.dequeue() )







def     _a				(      ):







     '''simple docstring'''


     SCREAMING_SNAKE_CASE__				:				Dict			=		ElementPriorityQueue()
     epq.enqueue(10 )
     epq.enqueue(70 )
     epq.enqueue(1_00 )
     epq.enqueue(1 )
     epq.enqueue(5 )
     epq.enqueue(7 )
     epq.enqueue(4 )
     epq.enqueue(64 )
     epq.enqueue(1_28 )
     print(lowercase__ )
     print(epq.dequeue() )
     print(epq.dequeue() )
     print(epq.dequeue() )
     print(epq.dequeue() )
     print(epq.dequeue() )
     print(lowercase__ )
     print(epq.dequeue() )
     print(epq.dequeue() )
     print(epq.dequeue() )
     print(epq.dequeue() )
     print(epq.dequeue() )


if __name__ == "__main__":
      fixed_priority_queue()
      element_priority_queue()



