Bells of Torrassa P88439


Statement
 

pdf   zip

thehtml

[r]

El Campanario de la Torrassa (see picture) is the bell tower of a church located in the district of La Torrassa in the city of L’Hospitalet de Llobregat. This bell tower 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 in the afternoon (19:00). In this case, at 19:00 the treble bells sound 4 times and the bass bells sound 7 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.

Your task is to simulate the operation of that bell tower.

Input

Input contains different test cases, one per line. Each test case consists of two integers: h and m, which encode an hour (and minutes) of the day and satisfy 0≤ h≤ 23 y 0≤ m≤ 59.

Output

For each test case h ⁠ ⁠ m, your program must print a line. Specifically, if the bells must sound in that moment, it must print the produced sound. Each bass bell sounds as “dong” and each treble bell sounds as “ding”. Words must be separated by a space. In case that in the hour h ⁠ ⁠ m any bell must sound, it must print “silence until HH:MM” where “HH:MM” is the next hour where the bells must sound.

Public test cases
  • Input

    19 0 
    19 5
    19 15
    19 30
    19 44
    19 45
    20 0
    23 59
    0 0
    12 0
    11 59
    7 5
    

    Output

    ding ding ding ding dong dong dong dong dong dong dong
    silence until 19:15
    ding
    ding ding
    silence until 19:45
    ding ding ding
    ding ding ding ding dong dong dong dong dong dong dong dong
    silence until 00:00
    ding ding ding ding dong dong dong dong dong dong dong dong dong dong dong dong
    ding ding ding ding dong dong dong dong dong dong dong dong dong dong dong dong
    silence until 12:00
    silence until 07:15
    
  • Information
    Author
    Jordi Petit
    Language
    English
    Translator
    Carlos Molina
    Original language
    Spanish
    Other languages
    Spanish
    Official solutions
    C++
    User solutions
    C++ Python