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 limit | Fine |
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
Input40 39 OutputCongratulations, you are within the speed limit! |
Input100 131 OutputYou are speeding and your fine is $500. |
Input100 120 OutputYou 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)
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
Please note there are other cases besides the sample cases. You should try to think about what other cases are possible.
Emphasis not mine.