#t12. 出租车车费计算

出租车车费计算

Taxi Fare

Problem Description

A city's standard taxi fares are as follows:

The first 3 km is a flag-fall charge of 10 yuan; for the part of the trip between 3 and 10 km, 2 yuan per km; for the part beyond 10 km, 3 yuan per km; during the trip, if the taxi stops temporarily because of traffic or at the passenger's request, 2 yuan is charged for every 5 minutes (less than 5 minutes is free of charge).

Input Format

The input gives the distance travelled (in km, with 1 decimal place) and the waiting time (an integer, in minutes) on one line, separated by a space.

Output Format

Print on one line the fare the passenger should pay (in yuan), rounded to the nearest yuan.

Sample Input 1

3.0 0

Sample Output 1

10

Sample Input 2

12.5 9

Sample Output 2

34

Constraints

0.0≤0.0 \le distance ≤1000.0\le 1000.0 (km, 1 decimal place), 0≤0 \le waiting time ≤1000\le 1000 (minutes, integer)

Hint

  • The pricing rules are given above. Note that "between 3 and 10 km" describes the total distance being in that range, while only the kilometres that actually fall inside the interval are charged at that rate — use sample 2 to compute every term on paper before writing code.
  • For the waiting fee, "less than 5 minutes is free" — integer division expresses exactly that.
  • Finally, round to the nearest yuan: think about how to turn 33.5 into 34.