Programming Geek
Rated 4.1/5 based on 446 reviews

CodeVita Season IV Round 1 : Recurring Deposit

Problem : Recurring Deposit

Manisha is a smart investor. She has opened a Recurring Deposit (RD) account with a bank. She has negotiated smartly with the bank. Bank has agreed to vary the interest rate on her RD account such that she is always able to comfortably beat inflation.

Your task is to calculate maturity value of her RD account in face of varying interest rates that she will enjoy.
Input Format:

First line contains principle amount P
Second line contains original rate of interest per annum R
Third line contains tenure in months T
Next few lines contain a tuple with 3 values. Each tuple contains delimited by whitespace, where updated _rate is applied on From_month and To_month, both inclusive.
-1 shows the end of input
Output Format:

Print the maturity amount after specified tenure or month in the format "Final_Amount "
Constraints:
P > 0 ; it can be float value
R >=0 ; it can be float value
T >0 ; it can be integer only
Calculation should be done upto 11-digit precision
Maturity amount should be printed to its nearest integer value
Sample Input and Output

SNo.InputOutput
1
5000
10
12
3 7 11
8 12 12
-1

Final_Amount 63657
2
2565.50
7.5
12
6 12 8
-1

Final_Amount 32097
3
200.75
6.9
5
-1

Final_Amount 1021
Note:

Please do not use package and namespace in your code. For object oriented languages your code should be written in one class.
Note:

Participants submitting solutions in C language should not use functions from / as these files do not exist in gcc
Note:

For C and C++, return type of main() function should be int.