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
Nguồn bài:
Dạng bài
Ngôn ngữ cho phép
C, C++, Java, Kotlin, Pascal, PyPy, Python, Scratch
You bought a laptop which costed ~N~ VND and you need to pay ~X~ VND per month for ~M~ months. In the ~K^{th}~ 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 ≤ 10^5)~
Output
- The amount of money you need to pay (rounded to nearest integer)
Sample Input 1
10 1 12 5
Sample Output 1
7
Sample Input 2
10 1 15 10
Sample Output 2
5
Sample Input 3
100 10 24 10
Sample Output 3
90
Bình luận