Petrol

Interview

Time limit2sMemory limit512 MB

Summary
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 nn (0≤n≤2000 \le n \le 200), the amount of petrol that will be used in the next month. The second line contains an integer kk (0≤k≤3600 \le k \le 360), 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.

Examples2

  1. Example 1

    Input
    41
    0
    
    Expected output
    61500
    
  2. Example 2

    Input
    125
    40
    
    Expected output
    225000