Interest (1)

Given an initial capital cc in euros, an annual interest rate ii (expressed in %), a time tt in years and an indication whether the interest is simple or compound, determine the amount of euros the initial capital is transformed into.

Input

The input consists of two strictly positive real numbers cc and ii, followed by a strictly positive integer tt, followed by either the word “simple” or the word “compound”.

Output

Write the final capital with 4 decimal places.

Observation

If you program in C++, use the double data type and put these two lines at the beginning of your main():

    cout.setf(ios::fixed);
    cout.precision(4);

Problem information

Author: Unknown
Translator: Gabriel Valiente

Generation: 2026-01-25T12:05:48.738Z

© Jutge.org, 2006–2026.
https://jutge.org