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)

My program is working as it requires it to be, but the test cases shows me this:
Test case #1: WA [0.005s, 2888K] (0/3) (Details)
Test case #2: AC [0.004s, 2888K] (3/3)
Test case #3: WA [0.005s, 2888K] (0/3) (Details)
Test case #4: WA [0.004s, 2888K] (0/3) (Details)
Test case #5: WA [0.004s, 2888K] (0/3

HELP

Your program is not working. In fact, it is not even working for the sample input; check your output carefully.

Please note there are other cases besides the sample cases. You should try to think about what other cases are possible.

on my computer its working fine, even with the sample inputs

he is saying that your code does not produce the right results

Look carefully at your output.

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.

Realized that too late... 3 re-submissions too late...