Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб. bfs.
Simple interest
Question: You deposit $PV in a bank account that pays simple interest rate of r%.
Bank applies different interest rates according to the time.
- If time is less than 1 year: interest rate =0.0%
- If time is between 1 and 3 years(both included): interest rate =5.7%
- If time is greater than 3 years: interest rate =12.6%
Simple interest is calculating using this formula:
FV=PV*(1+r*t)
Where:
- FV is future value, total Accrued Amount (principal + interest)
- PV is the present value (principal amount).
- r is the interest rate.
- t is the time involved.
How much will you have in your account after t years?
Input specification: You will be given two inputs. Principal amount 0.0<PV<=5000000.00, and the time 0.1<=t<=15.0
Output specification: Show your account's amount as floating point number with two digits precision.
Sample Input I
1000.00 0.5 |
Sample Input II
25789.50 2.5 |
Sample Output I
1000.00 |
Sample Output II
29464.50 |
Sample Input II Explanation: Because time (t) is between 1 and 3 the rate interest is calculated as 5.7%. Using simple interest formula we calculate FV:
FV=PV*(1+r*t) = 25789.50*(1+ (0.057*2.5) = 25789.50*1.1425=29464.50375
FV=29464.50
Для отправки решений необходимо выполнить вход.
|