CCC '05 J1 - The Cell Sell

View as PDF

Submit solution

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

Problem type
Canadian Computing Competition: 2005 Stage 1, Junior #1

Moe Bull has a cell phone and after a month of use is trying to decide which price plan is the best for his usage pattern. He has two options, each plan has different costs for daytime minutes, evening minutes and weekend minutes.

Plan Costs
daytime evening weekend
A 100 free minutes then 25 cents per minute 15 cents per minute 20 cents per minute
B 250 free minutes then 45 cents per minute 35 cents per minute 25 cents per minute

Write a program that will input the number of each type of minutes and output the cheapest plan for this usage pattern, using the format shown below. The input will be in the order of daytime minutes, evening minutes and weekend minutes. In the case that the two plans are the same price, output both plans.

Sample Input 1


Sample Output 1

Plan A costs 51.25
Plan B costs 18.95
Plan B is cheapest.

Sample Input 2


Sample Output 2

Plan A costs 37.85
Plan B costs 37.85
Plan A and B are the same price.


  • 7
    Dr_Richard_Evans  commented on Dec. 11, 2023, 9:24 p.m.

    This desperately requires an extra line explaining explicitly how many decimal places are required (2), even with 0 (e.g. 0.00). This is very badly written.

  • 1
    maxcruickshanks  commented on Aug. 23, 2022, 12:01 a.m. edited

    Since the original data were weak, an additional test case was added, and all Accepted submissions were rejudged.