#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 PP earns a fixed interest rate of rr 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 nn years, compute the balance after exactly nn years. If n=0n=0, the balance is PP. Round only the final printed result, not intermediate yearly balances.

Input

One line contains real values PP and rr, followed by an integer nn, in that order. PP is the principal, rr is the annual percentage rate, and nn is the number of years.

Output

Print the balance after nn 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%): 0<P≤106, 0≤r≤10, 0≤n≤20<P\le10^6,\ 0\le r\le10,\ 0\le n\le2.
  • Subtask 2 (30%): 0<P≤106, 0≤r≤50, 0≤n≤200<P\le10^6,\ 0\le r\le50,\ 0\le n\le20.
  • Subtask 3 (50%): 0<P≤106, 0≤r≤100, 0≤n≤1000<P\le10^6,\ 0\le r\le100,\ 0\le n\le100.

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.