HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Contests > Prog_CMP > problem:


1. Question 1

Prog_CMP

Start: Mar.02.2019 at 10:00:00 AM
Finish: Mar.02.2019 at 12:00:00 PM
The contest is finished!
• Contest scoreboard

Contest problems

• 1. Question 1

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.
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
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

 
Для отправки решений необходимо выполнить вход.

www.contester.ru