Loading...
Loading...
Loading...
An electricity bill uses slabs. The first 100 units cost 5 each, the next 100 units (101 to 200) cost 8 each, and every unit above 200 costs 12.
Given the units used, print the total bill.
Example 1
Input
150
Output
900
Example 2
Input
250
Output
1900
Try the problem first. Open one hint at a time.
Work out how many units fall in each slab, then multiply by that slab rate.
For a slab, the cost of earlier slabs is fixed: 500 for the first 100 units and 800 more for the next 100.
Write your Python code, run it on the examples and submit it to hidden tests.
Solve in the editor