## Task $7 / 90$

Three mathematicians are sitting together in a cheerful circle in the evening. One of them says: "Just now it was still $h$ hours, $m$ minutes, and $s$ seconds until midnight, where $h, m$, and $s$ are three prime numbers that satisfy the equation $3 s = h + m$." The second one replies: "The number of minutes until midnight was also a prime number." And the third one says after a glance at the calculator: "Even the number of seconds was a prime number."

What time was it?
The following considerations lead to the solution:

1. It is certain that $h \leq 7$, as otherwise it would not be "in the evening."
2. It is certain that one of the three prime numbers $h, m$, and $s$ is even. If this were $s$, then $3 s=6=h+m$, so $h=m=3$, and the number of minutes until midnight would be $60 h+m=183$, which is not a prime number. Therefore, $s \geq 3$ and either $h=2$ or $m=2$ (the case $s=h=m=2$ is obviously excluded). 3. If $m=2$, the number of minutes until midnight, $60 h+2$, would never be a prime number. Thus, $h=2$ and $m \geq 3$.
3. It is certain that $m<60$. Given $h=2$ and $3 s=h+m$, $m+2$ must be divisible by 3. Therefore, the only possible prime numbers for $m$ are $7, 13, 19, 31, 37$, and 43. For $m=43$, $s$ does not result in a prime number, and for $m=13$, the number of minutes until midnight is $133=7 \cdot 19$, which is not a prime number.
4. Only the possibilities $m_{1}=7, m_{2}=19, m_{3}=31$, and $m_{4}=37$ remain. For the number of seconds $S_{i}$ until midnight, we get $S_{1}=7623=3^{2} \cdot 7 \cdot 11^{2}$, $S_{2}=8347=17 \cdot 491$, $S_{3}=9071=47 \cdot 193$, and $S_{4}=9433$. Only $S_{4}$ is a prime number.
5. This results in the time being 2 hours 37 minutes 13 seconds before midnight. It was $21 \mathrm{~h} 22 \mathrm{~min} 47 \mathrm{~s}$.