Under construction

Still being built. Things may change

Lamps

Time limit1sMemory limit1024 MB

Summary
Given the daily hours a lamp is on and the electricity price, find the first day the low-energy lamp's total cost drops below the incandescent bulb's.
Level

Easy2 of 10

Topics
Simulation, Math
Solved
No attempts yet

Problem

The use of incandescent bulbs is about to be phased out in the EU, but low-energy lamps can already pay off. Write a program that, given how many hours a lamp is on each day and the electricity price, computes after how many days the total cost (lamp purchases plus electricity cost) of the low-energy lamp is first lower than that of the incandescent bulb.

Incandescent bulbLow-energy lamp
Power (W)6011
Lifetime (hours)10008000
Purchase price (kronor)560

For simplicity, assume every lamp lasts exactly its stated lifetime. So one incandescent bulb is enough to keep the lamp on for 1000 hours, but for 1001 hours you must buy another bulb, because the first one burns out after 1000 hours.

The electricity cost K for keeping the lamp on for H hours is computed with K=E⋅H⋅P100 000K = \frac{E \cdot H \cdot P}{100\,000} where E is the lamp's power in watts and P is the electricity price in öre/kWh.

In all test cases, only one low-energy lamp needs to be bought. The low-energy lamp is therefore cheaper even before it has to be replaced.

Input

The input is one line with two integers: hh (1≤h≤241 \le h \le 24), the number of hours per day the lamp is on, and PP (1≤P≤2001 \le P \le 200), the electricity price.

Output

Print the number of days after which the low-energy lamp is cheaper than the incandescent bulb.

Hint

After 149 days, the total cost with incandescent bulbs is 71.32840 kronor (of which 10 kronor is purchase cost, since one bulb has to be replaced once). With the low-energy lamp, it is 71.24354 kronor (of which 60 kronor is purchase cost).

Examples1

  1. Example 1

    Input
    7 98
    
    Expected output
    149