def solve_1d_quadratic(p, q, r=0):
    """
    Finds the minimizer of an 1-D quadratic system,
    raises an error if there is no minimizer (p<0)

    Inputs:
        - p, q, r: the coefficients of the 1D quadratic system

    Output:
        - xstar: the minimizer
    """
    assert ...
    return ...