|
|||
ChimesIn the village of Bellstown, a new clock system has been installed into the old church’s tower. The new clock makes the bell chime every hour on the hour, exactly as many times as the small clock hand shows (e.g., two times at 2 o’clock as well as at 14 o’clock). Additionally, the bell chimes one time at quarter past every hour, two times at half past every hour and one time at quarter to every hour of every day and night. Since the new clock system was installed, tourists have been continuously asking the old bellman how many times the bell chimes between two times. The bellman needs your help to answer these questions as fast as possible. Your task is to write a program that computes the number of bell chimes between two times of a day. Input SpecificationThe input contains multiple test cases. Each test case consists of a single line that contains two times separated by a space. The form of a time is HH:MM, where HH is the hour given either by one or two digits ranging from 0 to 24, and MM is the minute given exactly by two digits ranging from 0 to 59. The first time of a day is 0:00 and the last time of a day is 24:00. Both times are within a day, and the first time (start time) is always less than the second time (end time). Output SpecificationOutput for each test case is a line with a single integer, which is the number of bell chimes between the two given times, the start time exclusive and the end time inclusive. Sample Input
Output for Sample Input
|
|||
University of Debrecen; Faculty of Informatics; v. 09/30/2024 |