
"""simple docstring"""

from math import isclose, sqrt




def      lowercase__    (       lowerCAmelCase					:       float			,					lowerCAmelCase					:       float			,					lowerCAmelCase					:       float			)			->   tuple[float, float, float]:






    """simple docstring"""




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

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

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

    return next_x, next_y, outgoing_gradient




def      lowercase__    (       lowerCAmelCase					:       float = 1.4			,					lowerCAmelCase					:       float = -9.6			)			->   int:






    """simple docstring"""




    UpperCAmelCase          =       0
    UpperCAmelCase          =       first_x_coord
    UpperCAmelCase          =       first_y_coord
    UpperCAmelCase          =       (10.1 - point_y) / (0.0 - point_x)

    while not (-0.01 <= point_x <= 0.01 and point_y > 0):
        UpperCAmelCase      ,				UpperCAmelCase      ,				UpperCAmelCase          =       next_point(lowerCAmelCase			,					lowerCAmelCase			,					lowerCAmelCase			)
        num_reflections += 1

    return num_reflections


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





"""simple docstring"""

from math import ceil, sqrt




def      lowercase__    (       lowerCAmelCase					:       int = 1_000_000			)			->   int:






    """simple docstring"""




    UpperCAmelCase          =       0

    for outer_width in range(3			,					(limit // 4) + 2			):
        if outer_width**2 > limit:
            UpperCAmelCase          =       max(ceil(sqrt(outer_width**2 - limit			)			)			,					1			)
        else:
            UpperCAmelCase          =       1
        if (outer_width - hole_width_lower_bound) % 2:
            hole_width_lower_bound += 1

        answer += (outer_width - hole_width_lower_bound - 2) // 2 + 1

    return answer


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



