练21.5 打车费用
You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.
Description
On the weekend, Glaire and her father took a taxi to the amusement park. The taxi fare scheme is as follows:
- For the first 2 kilometers, the base fare is 6 yuan;
- For the distance exceeding 2 kilometers, the fare is 1.8 yuan per kilometer;
- For the distance exceeding 10 kilometers, the fare for the part exceeding 10 kilometers is increased by 50% on top of 1.8 yuan per kilometer.
- In addition, waiting time is charged: for every 3 minutes of waiting, an extra 1 yuan is charged (less than 3 minutes is not charged).
Input Format
Two integers, representing the driving distance (in kilometers) and the waiting time (in minutes).
Output Format
A single number representing the total fare. If it is a decimal, output to one decimal place; if it is an integer, do not output the decimal part.
Sample
1 37
20251213 A班作业(10)
- Status
- Done
- Problem
- 10
- Open Since
- 2025-12-13 0:00
- Deadline
- 2025-12-21 23:59
- Extension
- 24 hour(s)