Time Decomposition (3)

[Like Time Decomposition (2), P22654, but for Python instead of C.]

Write a function @decompose(n)@ that receives as argument a quantity of seconds nn, and returns how many hours hh, minutes mm and seconds ss it represents.

That is, we must have 3600h+60m+s=n3600h + 60m + s = n, with 0<=s<600 <= s < 60 and 0<=m<600 <= m < 60.

Sample session

Problem information

Author: ProAl

Generation: 2026-01-25T13:54:39.024Z

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