1999 LSU Computer Science High School Programming Contest
Novice Problem 7
Mister, do you know how fast you were going?

The small town of Petticoat Junction has hired you to help solve a problem that recently appeared. A while back the town of Petticoat Junction changed the speed limits at several locations. Since then, their sheriff and deputy have been constantly writing speeding tickets. Now they have so many tickets they need you to write a program to calculate the cost of the tickets.

The fine for speeding tickets in Petticoat Junction is calculated as follows:

Examples:
If the speed limit is 30 and the ticketed vehicle was traveling at 36 mph, the fine would be $35 + 6x$5, for a total of $65.
If the speed limit is 45 and the ticketed vehicle was traveling at 65 mph, the fine would be $35 + 14x$5 +6x$9, for a total of $159.

As you can see, speeding is a very expensive proposition in Petticoat Junction. Below are some samples from their data file with the ticket information. Each record has three numbers. The first number is the ticket number, the second number is the speed limit, and the third number is the clocked speed of the vehicle. You are to keep processing until you encounter ticket number -1.

Sample Input Data:

13975 
30 
36
14362 
45 
65
13977 
65 
101
-1

Sample Output:

Ticket # 13975    MPH over: 6      Fine: $65
Ticket # 13462    MPH over: 20     Fine: $159
Ticket # 13977    MPH over: 36     Fine: $303

Totals:  3 tickets for a total fine of $527

Spacing across the lines are not critical. Columns are not required to line up, but each line should have three distinct portions. A blank line must separate the last ticket from the totals line.



Return to the Top of Page, First Page, Novice Problem Set, or Veteran Problem Set.


Clarifications:







Return to the Top of Page, First Page, or Novice Problem Set.



The statements and opinions included in these pages are those of the LSU High School Programming Contest Staff only. Any statements and opinions included in these pages are not those of Louisiana State University or the LSU Board of Supervisors.
© 1999 LSU High School Programming Contest

Return to the LSU High School Programming Contest Homepage