Submit | All submissions | Best solutions | Back to list |
EIINPUR - Installment purchase |
You bought a laptop which costed N VND and you need to pay X VND per month for M months. In the Kth month, you want to pay the remaining cost, how much you need to pay? Please note that the store applies the same interest rate on the remaining cost every month (before you pay) and the interest rate has four decimal places.
Input
The first line contains four integer N, X, M, K (n ≤ 105)
Output
The amount of money you need to pay (rounded to nearest integer)
Sample
Input |
Output |
10 1 12 5 |
7 |
10 1 15 10 |
5 |
100 10 24 10 |
89 |
Added by: | Ha Minh Ngoc |
Date: | 2019-12-15 |
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 |