



"""simple docstring"""






from math import isclose, sqrt






def   snake_case__     (	__lowerCamelCase       :					Dict							,	__lowerCamelCase       :					List[Any]							,	__lowerCamelCase       :					List[Any]			):
			"""simple docstring"""
			lowerCamelCase__	:	Dict				=point_y / 4 / point_x
			lowerCamelCase__	:	List[str]				=2 * normal_gradient / (1 + normal_gradient * normal_gradient)
			lowerCamelCase__	:	List[Any]				=(1 - normal_gradient * normal_gradient) / (
			    1 + normal_gradient * normal_gradient
			)
			lowerCamelCase__	:	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
			lowerCamelCase__	:	Tuple				=outgoing_gradient**2 + 4
			lowerCamelCase__	:	Optional[int]				=2 * outgoing_gradient * (point_y - outgoing_gradient * point_x)
			lowerCamelCase__	:	Optional[int]				=(point_y - outgoing_gradient * point_x) ** 2 - 100

			lowerCamelCase__	:	str				=(
			    -linear_term - sqrt(linear_term**2 - 4 * quadratic_term * constant_term			)
			) / (2 * quadratic_term)
			lowerCamelCase__	:	Optional[int]				=(
			    -linear_term + sqrt(linear_term**2 - 4 * quadratic_term * constant_term			)
			) / (2 * quadratic_term)

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

			return next_x, next_y, outgoing_gradient






def   snake_case__     (	__lowerCamelCase       :					List[Any] = 1.4							,	__lowerCamelCase       :					int = -9.6			):
			"""simple docstring"""
			lowerCamelCase__	:	int				=0
			lowerCamelCase__	:	float				=first_x_coord
			lowerCamelCase__	:	float				=first_y_coord
			lowerCamelCase__	:	float				=(10.1 - point_y) / (0.0 - point_x)

			while not (-0.01 <= point_x <= 0.01 and point_y > 0):
						lowerCamelCase__	:	str				=next_point(__lowerCAmelCase							,	__lowerCAmelCase							,	__lowerCAmelCase			)
						num_reflections += 1

			return num_reflections


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









"""simple docstring"""






def   snake_case__     (	__lowerCamelCase       :					list[list[int]]							,	__lowerCamelCase       :					int							,	__lowerCamelCase       :					int							,	__lowerCamelCase       :					list[int]			):
			"""simple docstring"""

			# 1. Validate that path exists between current and next vertices
			if graph[path[curr_ind - 1]][next_ver] == 0:
						return False

			# 2. Validate that next vertex is not already in path
			return not any(vertex == next_ver for vertex in path			)






def   snake_case__     (	__lowerCamelCase       :					list[list[int]]							,	__lowerCamelCase       :					list[int]							,	__lowerCamelCase       :					int			):
			"""simple docstring"""

			# Base Case
			if curr_ind == len(__lowerCamelCase			):
						# return whether path exists between current and starting vertices
						return graph[path[curr_ind - 1]][path[0]] == 1

			# Recursive Step
			for next_ver in range(0							,	len(__lowerCamelCase			)			):
						if valid_connection(__lowerCamelCase							,	__lowerCamelCase							,	__lowerCamelCase							,	__lowerCamelCase			):
									# Insert current vertex  into path as next transition
									lowerCamelCase__	:	Tuple				=next_ver
									# Validate created path
									if util_hamilton_cycle(__lowerCamelCase							,	__lowerCamelCase							,	curr_ind + 1			):
												return True
									# Backtrack
									lowerCamelCase__	:	int				=-1
			return False






def   snake_case__     (	__lowerCamelCase       :					list[list[int]]							,	__lowerCamelCase       :					int = 0			):
			"""simple docstring"""
			lowerCamelCase__	:	Tuple				=[-1] * (len(__lowerCamelCase			) + 1)
			# initialize start and end of path with starting index
			lowerCamelCase__	:	Union[str, Any]				=start_index
			# evaluate and if we find answer return path either return empty array
			return path if util_hamilton_cycle(__lowerCamelCase							,	__lowerCamelCase							,	1			) else []




