#CCBOTPBA0000063. Lãi kép qua nhiều hồ sơ (Compound Interest for a Savings Record)
Lãi kép qua nhiều hồ sơ (Compound Interest for a Savings Record)
Compound Interest for a Savings Record
Source: Phước Hưng OJ
Version: Phuoc Hung OJ Extended
Problem Statement
An initial deposit earns a fixed interest rate of percent per year. At the end of each year, the earned interest is added to the balance; the updated balance earns interest in the following year. There are no other deposits or withdrawals. Given years, compute the balance after exactly years. If , the balance is . Round only the final printed result, not intermediate yearly balances.
Input
One line contains real values and , followed by an integer , in that order. is the principal, is the annual percentage rate, and is the number of years.
Output
Print the balance after years on one line, using exactly two digits after the decimal point. Do not print a currency symbol or an input prompt.
Subtasks
- Subtask 1 (20%): .
- Subtask 2 (30%): .
- Subtask 3 (50%): .
Examples
Example 1
Input:
1000 10 2
Output:
1210.00
Explanation: The first year adds 1000 × 10/100 = 100, leaving 1100. The second adds 1100 × 10/100 = 110, leaving 1210. Print 1210.00.
Example 2
Input:
735.25 0 100
Output:
735.25
Explanation: The interest rate is zero, so the balance stays 735.25 through all 100 years.
Example 3
Input:
250.50 12.5 0
Output:
250.50
Explanation: No year elapses, so no interest is applied and the initial 250.50 is printed.