```python
def tier_cost(units: int, allowance: int, first_rate: int, later_rate: int) -> int:
    """
    Calculate the cost of a given number of units charged at a tiered rate.

    Units are charged at the first rate up to the allowance limit, and at the
    later rate for any units beyond the allowance. The cost is returned in
    whole pence.

    Args:
        units: The number of units to charge.
        allowance: The number of units charged at the first rate.
        first_rate: The cost per unit charged at the first rate (in pence).
        later_rate: The cost per unit charged at the later rate (in pence).

    Returns:
        The total cost in whole pence.

    Raises:
        ValueError: If units is negative.
    """
    if units < 0:
        raise ValueError("Number of units must be non-negative")

    if allowance < 0:
        allowance = 0

    if units <= allowance:
        return units * first_rate
    else:
        return allowance * first_rate + (units - allowance) * later_rate
```