TopCoder problem "CellularPhoneTarif" used in TCHS07 Alpha 2 (Division I Level One)



Problem Statement

    

You have spoken seconds seconds by phone and you'd like to calculate the cost of the call. Starting a call always costs you 5 cents, regardless of the call's duration. Additionally, you need to pay for every minute you've been talking. Any fractional minute is charged at full price, so if you've talked for 65 seconds, you'll be charged for 2 minutes. Also, the timer for a new minute starts when your 60-th, 120-th, 180-th, ... second ends (if you talk for 120 seconds, you'll be charged for 3 minutes).

The payment for the call itself is a bit complicated. During the first 5 minutes of the call, you must pay 10 cents for each minute that you've talked. After the first 5 minutes of the call, each additional minute will cost you only 3 cents. Given the duration of your call in seconds, return the cost of the call.

 

Definition

    
Class:CellularPhoneTarif
Method:calculatePrice
Parameters:int
Returns:int
Method signature:int calculatePrice(int seconds)
(be sure your method is public)
    
 

Constraints

-seconds will be between 0 and 10000, inclusive.
 

Examples

0)
    
65
Returns: 25
1)
    
300
Returns: 58
2)
    
100
Returns: 25
3)
    
0
Returns: 15
4)
    
301
Returns: 58
5)
    
240
Returns: 55

Problem url:

http://www.topcoder.com/stat?c=problem_statement&pm=7546

Problem stats url:

http://www.topcoder.com/tc?module=ProblemDetail&rd=10716&pm=7546

Writer:

Mike Mirzayanov

Testers:

PabloGilberto , brett1479 , Olexiy

Problem categories:

Simple Math