2012 Canadian Computing Competition, Stage 1

Problem J1: Speed fines are not fine!

Many communities now have "radar" signs that tell drivers what their speed is, in the hope that they will slow down.

You will output a message for a "radar" sign. The message will display information to a driver based on his/her speed according to the following table:

KM over the limitFine
1 to 20$100
21 to 30$270
31 or above$500

Input Format

Two numbers: first, the speed limit; second, the recorded speed of the car.

Output Format

If the driver is not speeding, the output should be:

Congratulations, you are within the speed limit!

If the driver is speeding, the output should be:

You are speeding and your fine is $F.

where F is the amount of the fine as described in the table above.

Sample Data

Input

40
39

Output

Congratulations, you are within the speed limit!

Input

100
131

Output

You are speeding and your fine is $500.

Input

100
120

Output

You are speeding and your fine is $100.

All Submissions
Best Solutions


Point Value: 3
Time Limit: 2.00s
Memory Limit: 16M
Added: Feb 29, 2012

Languages Allowed:
C++03, PAS, C, HASK, ASM, RUBY, PYTH2, JAVA, TEXT, PHP, SCM, CAML, PERL, C#, C++11, PYTH3

Comments (Search)

In the original problem text, submissions are required to prompt the user. However, since the prompts are missing from both the description and the problem data on WCIPEG, solutions that work here won't work with the CCC grader, and vice versa.

This is intentional. Per the README:
Input and output are to be in the exact format indicated on the problem description. Do not prompt for input by printing lines such as "Enter the number of points"; these will end up in the output and your program will be graded incorrect.


Emphasis not mine.