


from math import isclose, sqrt





def        _lowercase   (  _UpperCAmelCase     , _UpperCAmelCase     , _UpperCAmelCase			)  ->					Dict:
				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 - 1_00

				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(__lowerCamelCase     , __lowerCamelCase			) 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			)  ->					Optional[int]:
				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			=next_point(__lowerCamelCase     , __lowerCamelCase     , __lowerCamelCase			)
								num_reflections += 1

				return num_reflections


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












import qiskit





def        _lowercase   (  _UpperCAmelCase     , _UpperCAmelCase			)  ->					qiskit.result.counts.Counts:
				lowerCamelCase			=qiskit.Aer.get_backend("""aer_simulator"""			)

				# Create a Quantum Circuit acting on the q register
				lowerCamelCase			=qiskit.QuantumCircuit(_UpperCAmelCase     , _UpperCAmelCase			)

				# Map the quantum measurement to the classical bits
				circuit.measure([0]     , [0]			)

				# Execute the circuit on the simulator
				lowerCamelCase			=qiskit.execute(_UpperCAmelCase     , _UpperCAmelCase     , shots=10_00			)

				# Return the histogram data of the results of the experiment.
				return job.result().get_counts(_UpperCAmelCase			)


if __name__ == "__main__":
							print(F"Total count for various states are: {single_qubit_measure(1, 1)}")





