Submit | All submissions | Best solutions | Back to list |
EIEASY07 - Electricity bill |
The electricity company offers the following formula for calculating the electricity bill:
The electricity company offers the following formula for calculating the electricity bill:
- The first 100 kWh cost 200 VND/Wh
- 1000 kWh for the subsequent price of 500 VND / kWh
- The next 2000 kWh are priced at 1,000 VND / kWh
- Next 5,000 kWh, priced at 10,000 VND / kWh
- Next 10,000 kWh are priced at 12,000 VND / kWh
- The remaining amount is 100,000 VND / kWh
Assuming that k kwh is consumed, how much is paid?
- The first 100 kWh cost 200 VND/Wh
- Next 1000 kWh for the subsequent price of 500 VND / kWh
- Next 2000 kWh are priced at 1,000 VND / kWh
- Next 5,000 kWh, priced at 10,000 VND / kWh
- Next 10,000 kWh are priced at 12,000 VND / kWh
- The remaining amount is 100,000 VND / kWh
Assuming that k kwh is consumed, what is the cost of the bill ?
Input
Only integer k(k<=10^9)
Output
Amount to pay
Example
Input: 150 Output: 45000
Added by: | Ha Minh Ngoc |
Date: | 2015-01-28 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | CSHARP C++ 4.3.2 CPP CPP14 JAVA |