Translate a progressive tariff into branches

Read integer usage u in 0..1000. Charge 2 credits per unit for the first 100 units, 3 per unit for the next 100, and 5 per unit beyond 200. These are progressive bands: usage 101 costs 100*2 + 1*3, rather than 101*3. There is no fixed fee.

    Write a complete C program printing bill=B, or invalid for failed/out-of-range input. State the expression used in each branch and give hand calculations for 0, 100, 101, 200 and 201. Show how your branch conditions cover every valid value exactly once.

Assume every integer token supplied is representable in int.


