A job scheduler stores timeouts as compact duration strings like 2h15m30s,
45m, or 90s. Each string contains an hours part (Nh), a minutes part (Nm),
and a seconds part (Ns) — each part optional, at least one present, always
in h -> m -> s order. Values are non-negative integers and may exceed the
usual clock ranges (e.g. 90m is valid).
Convert each duration to its total number of seconds.
Input Format:
Line 1: n (number of durations)
Lines 2 to n+1: one duration string per line
Output Format:
For each duration, its total seconds on its own line.