



from math import isclose, sqrt

def     __lowercase(	UpperCAmelCase__   ,   UpperCAmelCase__   ,   UpperCAmelCase__ ):


      """simple docstring"""



      lowerCamelCase								=		point_y / 4 / point_x
      lowerCamelCase								=		2 * normal_gradient / (1 + normal_gradient * normal_gradient)
      lowerCamelCase								=		(1 - normal_gradient * normal_gradient) / (
          1 + normal_gradient * normal_gradient
      )
      lowerCamelCase								=		(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
      lowerCamelCase								=		outgoing_gradient**2 + 4
      lowerCamelCase								=		2 * outgoing_gradient * (point_y - outgoing_gradient * point_x)
      lowerCamelCase								=		(point_y - outgoing_gradient * point_x) ** 2 - 100

      lowerCamelCase								=		(
          -linear_term - sqrt(linear_term**2 - 4 * quadratic_term * constant_term )
      ) / (2 * quadratic_term)
      lowerCamelCase								=		(
          -linear_term + sqrt(linear_term**2 - 4 * quadratic_term * constant_term )
      ) / (2 * quadratic_term)

      # two solutions, one of which is our input point
      lowerCamelCase								=		x_minus if isclose(UpperCAmelCase__   ,   UpperCAmelCase__ ) else x_plus
      lowerCamelCase								=		point_y + outgoing_gradient * (next_x - point_x)

      return next_x, next_y, outgoing_gradient

def     __lowercase(	UpperCAmelCase__ = 1.4   ,   UpperCAmelCase__ = -9.6 ):


      """simple docstring"""



      lowerCamelCase								=		0
      lowerCamelCase								=		first_x_coord
      lowerCamelCase								=		first_y_coord
      lowerCamelCase								=		(1_0.1 - point_y) / (0.0 - point_x)

      while not (-0.0_1 <= point_x <= 0.0_1 and point_y > 0):
            lowerCamelCase			,							lowerCamelCase			,							lowerCamelCase								=		next_point(UpperCAmelCase__   ,   UpperCAmelCase__   ,   UpperCAmelCase__ )
            num_reflections += 1

      return num_reflections


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




from __future__ import annotations

from collections import deque
from collections.abc import Iterator
from dataclasses import dataclass





@dataclass
class    lowerCamelCase__  :
     """simple docstring"""



     _A       =			42
     _A       =			42





class    lowerCamelCase__  :
     """simple docstring"""



     def __init__(self				,			__a    ):






           '''simple docstring'''



           lowerCamelCase								=		[[] for _ in range(__a    )]
           lowerCamelCase								=		size







     def __getitem__(self				,			__a    ):






           '''simple docstring'''



           return iter(self._graph[vertex]    )







     @property
     def 						_a      (self    ):






           '''simple docstring'''



           return self._size







     def 						_a      (self				,			__a				,			__a				,			__a    ):






           '''simple docstring'''



           if weight not in (0, 1):
                 raise ValueError("Edge weight must be either 0 or 1."    )

           if to_vertex < 0 or to_vertex >= self.size:
                 raise ValueError("Vertex indexes must be in [0; size)."    )

           self._graph[from_vertex].append(Edge(__a				,			__a    )    )







     def 						_a      (self				,			__a				,			__a    ):






           '''simple docstring'''



           lowerCamelCase								=		deque([start_vertex]    )
           lowerCamelCase								=		[None] * self.size
           lowerCamelCase								=		0

           while queue:
                 lowerCamelCase								=		queue.popleft()
                 lowerCamelCase								=		distances[current_vertex]
                 if current_distance is None:
                       continue

                 for edge in self[current_vertex]:
                       lowerCamelCase								=		current_distance + edge.weight
                       lowerCamelCase								=		distances[edge.destination_vertex]
                       if (
                           isinstance(__a				,			__a    )
                           and new_distance >= dest_vertex_distance
                       ):
                             continue
                       lowerCamelCase								=		new_distance
                       if edge.weight == 0:
                             queue.appendleft(edge.destination_vertex    )
                       else:
                             queue.append(edge.destination_vertex    )

           if distances[finish_vertex] is None:
                 raise ValueError("No path from start_vertex to finish_vertex."    )

           return distances[finish_vertex]


if __name__ == "__main__":
     import doctest

     doctest.testmod()