El campanar de la Torrassa P19724


Statement
 

pdf   zip

html

[r]

El Campanar de la Torrassa is the bell tower of a church of the district of La Torrassa in the city of L’Hospitalet de Llobregat, besides Barcelona. It is well known for continuously annoying its neighbors with the sound of its bells. Day or night, the bells sound every quarter in the traditional way: Suppose it is seven o’clock in the afternoon. In this case, at 19:00 the treble bells sound four times and the bass bells sound seven times. Then, at 19:15 the treble bells sound once. Latter, at 19:30 the treble bells sound twice. Finally, at 19:45 the treble bells sound thrice. Additionally, every noon the bass bells sound 100 times rather than 12 to signal the Angelus. Every time the bells start playing, they always finish strictly within the next minute.



(In fact, this is a simplification, because on Saturdays, Sundays and important dates extra bells are played to signal special masses, not to count August the 15th, when bells play all day long.)

A non-governmental organization that fights against acoustic pollution wishes to count the number of times that the bells sound in a large amount of time. Specifically, they need a program that, given a starting time (h:m) and a time length expressed in minutes t, computes the number of times that the bells sound during this period.

Input

Input consists of several cases, each with three integer numbers h, m and t. You can assume 0≤ h≤ 23, 0≤ m≤ 59 and 0≤ t ≤228.

Output

For every case, print the number of times that the bells sound starting at (h:m) for a length of t minutes.

Public test cases
  • Input

    19 0 0
    19 0 1
    10 0 15
    10 0 16
    0 0 5
    12 0 10
    23 57 1450
    

    Output

    0
    11
    14
    15
    16
    104
    500
    
  • Information
    Author
    Jordi Petit
    Language
    English
    Other languages
    Catalan
    Official solutions
    C++ Java Python
    User solutions
    C C++ Python
    Event
    Segon Concurs de Programació de la UPC - Segona Semifinal
    Date
    2004-09-15