#K71247. Taxi Fare Calculation
Taxi Fare Calculation
Taxi Fare Calculation
You are given the distance traveled by a taxi in kilometers and the time at which the ride started in 24-hour format (HH:MM). The taxi fare is calculated based on a base fare plus an additional cost per kilometer. The base fare is \(2.50\). The additional cost per kilometer depends on the time of day:
- If the ride starts between 06:00 (inclusive) and 22:00 (exclusive), the rate is \(1.75\) per kilometer.
- Otherwise, the rate is \(2.50\) per kilometer.
The total fare is the sum of the base fare and the distance multiplied by the rate, rounded to two decimal places.
inputFormat
The input is provided via stdin and consists of two lines:
- The first line contains a floating point number representing the distance traveled (in kilometers).
- The second line contains a time string in the format
HH:MM
representing the start time of the ride.
outputFormat
Output the total taxi fare to stdout as a floating point number rounded to two decimal places.
## sample10
08:30
20.00