Investment Calculator

View as PDF

Submit solution

Points: 3
Time limit: 2.0s
Memory limit: 64M

Author:
Problem type

An investment with an initial value of x is compounded annually at a rate of y. Using a loop, calculate the number of years needed until the investment is worth z.

Input

The first line of input contains x with at most 2 decimal places.
The second line of input contains z, with at most 2 decimal places.
The third line of input contains y, the rate of interest in percent with at most 2 decimal places. The interest will not be 0 or greater than 100%.

Output

Output the number of years needed before the interest with initial value x reaches a value of z with a compound interest of y every year.

Sample Input

100
200
12

Sample Output

7

Comments


  • 1
    selena_zhang  commented on Nov. 19, 2019, 7:53 p.m.

    Isn't y future value and z interest?