Installment Purchase 3

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

Nguồn bài:
Hà Minh Ngọc
Dạng bài
Ngôn ngữ cho phép
C, C++, Java, Kotlin, Pascal, PyPy, Python, Scratch

Tan is a manager of a mobile shop. The shop has imported many new products. Tan has to create detail payment plan for customer to pay in installment (Mua trả góp).

Installment purchase is popular payment method. For e.g. A Samsung Galaxy S20 Ultra has price of ~19,990,000~ vnd. Customer can buy the phone by pay ~10,000,000~ vnd now; pay ~1,097,000~ vnd each month in the next ~12~ months. Customer pay the same money every month.

Given the original price (~P~), the prepay money (~M~), the number of months that customer want to pay (~N~), and the expected monthly interest that the shop want (~R~). You have to write a program to help Tan calculate how much customer have to pay monthly.

Input

  • ~4~ numbers in one line:
    • The integer ~P~ ~(0 ≤ P ≤ 2 \times 10^9)~.
    • The integer ~M~ ~(0 ≤ M ≤ P)~.
    • The integer ~N~ ~(1 ≤ N ≤ 48)~.
    • The double ~R~ ~(0 < R ≤ 0.1)~.

Output

  • The money which customer have to pay monthly (~X~). Result is rounded down to unit.

Sample Input

19990000 10000000 12 0.045

Sample Output

1095565

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.