Phone Bill
InterviewTime limit1sMemory limit128 MB
Given N calls with a start time and duration under 60 minutes, sum the cost by charging 10 won per minute in 07:00-19:00 and 5 won otherwise, splitting calls that cross the boundary.
- Level
Easy3 of 10
- Topics
- Simulation, Implementation
- Solved
- No attempts yet
Problem
Phone rates depend on the time of day.
Each minute talked from 07:00 inclusive to 19:00 exclusive costs 10 won, and each minute talked from 19:00 inclusive to the next 07:00 exclusive costs 5 won.
Given the start time and duration of each call Sanggeun made, compute the total cost of all calls.
Input
The first line contains the number of calls N. (1 ≤ N ≤ 100)
Each of the next N lines contains one call in the format HH:MM DD.
HH:MM is the call start time, and DD is the call duration in minutes. DD is at most 60. There is exactly one space between MM and DD.
If the hour or minute has one digit, it is written with a leading zero.
Times range from 00:00 to 23:59.
Output
Print the total cost of all calls.