#119. 超速罚单等级判定

    ID: 119 Type: Default 1000ms 256MiB Tried: 0 Accepted: 0 Difficulty: (None) Uploaded By: Tags>codingbatLogic-1gesp1条件结构数学基础

超速罚单等级判定

Speeding Ticket

Background

You are driving a little too fast, and a police officer stops you.

Problem Description

Write code to compute the result, encoded as an integer value: 00 = no ticket, 11 = small ticket, 22 = big ticket. If speed is 6060 or less, the result is 00. If speed is between 6161 and 8080 inclusive, the result is 11. If speed is 8181 or more, the result is 22. Unless it is your birthday -- on that day, your speed can be 55 higher in all cases.

Input Format

Input is given from Standard Input in the following format.

speed is_birthday

Where speed is an integer representing your car's speed, and is_birthday is a boolean value (true or false) indicating if it's your birthday.

Output Format

Output is printed to Standard Output in the following format.

ticket_level

Where ticket_level is an integer representing the ticket level (00, 11, or 22).

Sample

60 false
0
65 false
1
65 true
0

Sample Explanation

Sample 1: Speed is 6060, not birthday. 606060 \le 60, so no ticket, result is 00. Sample 2: Speed is 6565, not birthday. 61658061 \le 65 \le 80, so small ticket, result is 11. Sample 3: Speed is 6565, is birthday. On birthday, speed limits are increased by 55. So 6560+5=6565 \le 60+5=65, no ticket, result is 00.

Constraints

  • 0speed1000 \le \text{speed} \le 100
  • is_birthday is true or false.