Petrol
InterviewTime limit2sMemory limit512 MB
Given the petrol n used next month and the leftover quota k, compute the cost where the first 60+k liters cost 1500 each and the rest cost 3000 each.
- Level
Easy1 of 10
- Topics
- Math, Implementation
- Solved
- No attempts yet
Problem
The government of Neverland has announced a new petrol rationing plan together with an unexpected price hike. Under the new plan, each person receives a monthly quota of 60 liters on a fuel card. Petrol within the quota costs 1500 Oshloobs per liter, and any petrol beyond the quota costs 3000 Oshloobs per liter.
After recovering from the shock, Mahya is trying to work out how dark the future is. The current month is coming to an end, and Mahya has some quota left on her fuel card that carries over to the next month. A quota of 60 liters is added to her fuel card at the very beginning of the next month. She also has a prediction of how much petrol she will use in the next month. Now she wants to know how much she has to pay for petrol in the next month. She is too lazy to work it out herself, so she needs your help.
Input
The input consists of two lines. The first line contains an integer (), the amount of petrol that will be used in the next month. The second line contains an integer (), the quota left on Mahya's fuel card at the end of the current month.
Output
Print the amount of money (in Oshloobs) that Mahya will pay for petrol in the next month.