"""Candidate refund helper for the review exercise. Integers are cents."""


def remaining_after_refund(paid_cents, refunded_cents, request_cents):
    """Return the balance after the requested refund."""
    if request_cents > paid_cents:
        raise ValueError("refund exceeds payment")
    return paid_cents - refunded_cents - request_cents
