-1
Implement tierCost. Units are charged at a first rate up to an included allowance and at a second rate for everything beyond it. Return the cost of a number of units in whole pence. Usage inside the allowance is charged at the first rate only. Reject with an error a number of units below zero.

Signature:
  export function tierCost(units: number, allowance: number, firstRate: number, laterRate: number): number

Examples:
  tierCost(10, 10, 10, 20)        // 10 * 10 = 100
  tierCost(25, 10, 10, 20)        // 10 * 10 + 15 * 20 = 100 + 300 = 400
  tierCost(5, 10, 10, 20)         // 5 * 10 = 50
  tierCost(-3, 10, 10, 20)       // Error: units must be >= 0