Bells of Torrassa

[image]

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.

Problem information

Author: Unknown
Translator: Carlos Molina

Generation: 2026-01-25T12:15:49.174Z

© Jutge.org, 2006–2026.
https://jutge.org
