Submit | All submissions | Best solutions | Back to list |
EIVINFASTBATERY - Vinfast Battery-lease Policy |
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 < 109, 0 < T ≤ 240, 0 < r ≤ 15).
Output
Print out minimum X (rounded to the nearest integer).
Sample
Input |
Output |
120000000 0 120 1 |
1721651 |
178000000 50000000 72 1 |
3002425 |
Added by: | Ha Minh Ngoc |
Date: | 2022-12-25 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | CSHARP C++ 4.3.2 CPP CPP14 CPP14-CLANG FSHARP GO JAVA JS-MONKEY NODEJS PHP PYTHON PYPY PYPY3 PYTHON3 RUBY SQLITE SWIFT VB.NET |