Vinfast Battery-lease Policy

Xem dạng PDF

Gửi bài giải

Điểm: 1,00 (OI)
Giới hạn thời gian: 1.0s
Giới hạn bộ nhớ: 256M
Input: stdin
Output: stdout

Dạng bài
Ngôn ngữ cho phép
C, C++, Java, Kotlin, Pascal, PyPy, Python, Scratch

Vinfast has battery-lease policy. A battery for a car cost N VND. Customer could rent battery at a cost of X VND per month. When a battery capacity drops below 70%, Vinfast will recall and replace the battery with a new one. The recalled battery is used to store electricity. Vinfast estimates that after T months, they have to recall battery, at the time of recall, the battery has a value of M VND. Suppose the interest rate a bank offer is r% per month for Vinfast to buy battery. Your task is to write a program to calculate the minimum X so that Vinfast can at least make a profit (no loss).

Input

The only line contains 3 integers N, M, T and a real number r (0 < N, M < 10^9, 0 < T ≤ 240, 0 < r ≤ 15).

Output

Print out minimum X (rounded to the nearest integer).

Example

Input
120000000 0 120 1
Output
1721651
Input
178000000 50000000 72 1
Output
3002425

Bình luận

Hãy đọc nội quy trước khi bình luận.


Không có bình luận tại thời điểm này.