def ComplementConstraint(A, b, C):
    """Complements a constraint and RHS for a complementing set C."""

    A_C = A[:]
    b_C = b
    for c in C:
        A_C[c - 1] *= -1
        b_C -= A[c - 1]
    return A_C, b_C