Congestion Charging Zone
InterviewTime limit2sMemory limit512 MB
Given up to 100 camera sighting times for one vehicle, find its first and last times in 6:30 to 19:00 and output the matching charge from the table.
- Level
Easy3 of 10
- Topics
- Implementation, Sorting
- Solved
- No attempts yet
Problem
The Tehran municipality has set up a new charging method for the Congestion Charging Zone (CCZ), which controls the passage of vehicles in Tehran's high-congestion areas during the congestion period (CP) from 6:30 to 19:00. There are plate detection cameras inside or at the entrances of the CCZ recording vehicles seen at the CCZ. The table below summarizes the new charging method.
Note that the first time and the last time that a vehicle is seen in the CP may be the same. Write a program to compute the amount of charge of a given vehicle in a specific day.
Input
The first line of the input contains a positive integer n (1 ≤ n ≤ 100) where n is the number of records for a vehicle. Each of the next n lines contains a time at which the vehicle is seen. Each time is of form <hour>:<minute>, where <hour> is an integer number between 0 and 23 (inclusive) and <minute> is formatted as an exactly two-digit number between 00 and 59 (inclusive).
Output
Print the charge to be paid by the owner of the vehicle in the output.