

from math import isclose, sqrt



def    __UpperCAmelCase (	__a      :			float		,__a      :			float		,__a      :			float	)			->     tuple[float, float, float]:

					"""simple docstring"""

					_a	:    Optional[int]         =		point_y / 4 / point_x
					_a	:    str         =		2 * normal_gradient / (1 + normal_gradient * normal_gradient)
					_a	:    str         =		(1 - normal_gradient * normal_gradient) / (
					    1 + normal_gradient * normal_gradient
					)
					_a	:    Union[str, Any]         =		(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
					_a	:    Union[str, Any]         =		outgoing_gradient**2 + 4
					_a	:    str         =		2 * outgoing_gradient * (point_y - outgoing_gradient * point_x)
					_a	:    Optional[int]         =		(point_y - outgoing_gradient * point_x) ** 2 - 100

					_a	:    Optional[Any]         =		(
					    -linear_term - sqrt(linear_term**2 - 4 * quadratic_term * constant_term	)
					) / (2 * quadratic_term)
					_a	:    List[str]         =		(
					    -linear_term + sqrt(linear_term**2 - 4 * quadratic_term * constant_term	)
					) / (2 * quadratic_term)

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

					return next_x, next_y, outgoing_gradient



def    __UpperCAmelCase (	__a      :			float = 1.4		,__a      :			float = -9.6	)			->     int:

					"""simple docstring"""

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

					while not (-0.01 <= point_x <= 0.01 and point_y > 0):
										_a      ,					_a      ,					_a	:    Union[str, Any]         =		next_point(__a		,__a		,__a	)
										num_reflections += 1

					return num_reflections


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






from collections.abc import Callable

class 				UpperCAmelCase_		:
							"""simple docstring"""







							def __init__(			self       ,							_a = None       )    ->    None:
												# Stores actual heap items.
												_a	:    list         =		[]
												# Stores indexes of each item for supporting updates and deletion.
												_a	:    dict         =		{}
												# Stores current size of heap.
												_a	:    Tuple         =		0
												# Stores function used to evaluate the score of an item on which basis ordering
												# will be done.
												_a	:    Dict         =		key or (lambda _a       : x)


							def 				__lowercase				(			self       ,							_a       )    ->    int | None:
												return int((i - 1) / 2       ) if i > 0 else None


							def 				__lowercase				(			self       ,							_a       )    ->    int | None:
												_a	:    Optional[int]         =		int(2 * i + 1       )
												return left if 0 < left < self.size else None


							def 				__lowercase				(			self       ,							_a       )    ->    int | None:
												_a	:    int         =		int(2 * i + 2       )
												return right if 0 < right < self.size else None


							def 				__lowercase				(			self       ,							_a       ,							_a       )    ->    None:
												_a      ,					_a	:    Union[str, Any]         =		(
												    self.pos_map[self.arr[j][0]],
												    self.pos_map[self.arr[i][0]],
												)
												# Then swap the items in the list.
												_a      ,					_a	:    List[Any]         =		self.arr[j], self.arr[i]


							def 				__lowercase				(			self       ,							_a       ,							_a       )    ->    bool:
												return self.arr[i][1] < self.arr[j][1]


							def 				__lowercase				(			self       ,							_a       )    ->    int:
												_a	:    Dict         =		self._left(_a       )
												_a	:    str         =		self._right(_a       )
												_a	:    str         =		i

												if left is not None and not self._cmp(_a       ,							_a       ):
																	_a	:    Optional[Any]         =		left
												if right is not None and not self._cmp(_a       ,							_a       ):
																	_a	:    Any         =		right

												return valid_parent


							def 				__lowercase				(			self       ,							_a       )    ->    None:
												_a	:    List[str]         =		self._parent(_a       )
												while parent is not None and not self._cmp(_a       ,							_a       ):
																	self._swap(_a       ,							_a       )
																	_a      ,					_a	:    Any         =		parent, self._parent(_a       )


							def 				__lowercase				(			self       ,							_a       )    ->    None:
												_a	:    List[Any]         =		self._get_valid_parent(_a       )
												while valid_parent != index:
																	self._swap(_a       ,							_a       )
																	_a      ,					_a	:    int         =		valid_parent, self._get_valid_parent(_a       )


							def 				__lowercase				(			self       ,							_a       ,							_a       )    ->    None:
												if item not in self.pos_map:
																	return
												_a	:    str         =		self.pos_map[item]
												_a	:    List[Any]         =		[item, self.key(_a       )]
												# Make sure heap is right in both up and down direction.
												# Ideally only one of them will make any change.
												self._heapify_up(_a       )
												self._heapify_down(_a       )


							def 				__lowercase				(			self       ,							_a       )    ->    None:
												if item not in self.pos_map:
																	return
												_a	:    Tuple         =		self.pos_map[item]
												del self.pos_map[item]
												_a	:    Tuple         =		self.arr[self.size - 1]
												_a	:    str         =		index
												self.size -= 1
												# Make sure heap is right in both up and down direction. Ideally only one
												# of them will make any change- so no performance loss in calling both.
												if self.size > index:
																	self._heapify_up(_a       )
																	self._heapify_down(_a       )


							def 				__lowercase				(			self       ,							_a       ,							_a       )    ->    None:
												_a	:    Union[str, Any]         =		len(self.arr       )
												if arr_len == self.size:
																	self.arr.append([item, self.key(_a       )]       )
												else:
																	_a	:    Optional[int]         =		[item, self.key(_a       )]
												_a	:    Tuple         =		self.size
												self.size += 1
												self._heapify_up(self.size - 1       )


							def 				__lowercase				(			self       )    ->    tuple | None:
												return self.arr[0] if self.size else None




							def 				__lowercase				(			self       )    ->    tuple | None:
												_a	:    Tuple         =		self.get_top()
												if top_item_tuple:
																	self.delete_item(top_item_tuple[0]       )
												return top_item_tuple



def    __UpperCAmelCase (	)			->     None:

					"""simple docstring"""



if __name__ == "__main__":
			import doctest

			doctest.testmod()



