An energy supplier bills usage in marginal tiers, like tax brackets:
- •the first 100 units cost 0.20 each,
- •units 101 to 500 cost 0.15 each,
- •every unit above 500 costs 0.10.
So 250 units cost 100 × 0.20 + 150 × 0.15 = 42.50.
Write bill(usage): usage is a pandas Series of non-negative whole numbers (one per customer). Return a Series of bills, rounded to 2 decimal places, with the same index. It must handle millions of customers, so it may not use a Python loop, a comprehension, or a per-row function (apply, map, np.vectorize). The grader checks your code for these.
Python 3.13 in your browser — the standard library plus pandas and numpy; no pip installs.