#C4197. Time String to Binary Format Converter
Time String to Binary Format Converter
Time String to Binary Format Converter
You are given several time strings in the format HH:MM:SS
, where HH
represents hours, MM
minutes, and SS
seconds. Your task is to convert each decimal value to its binary representation. Note that when converted to binary, no leading zeros should be added (i.e. the number 1 should be represented as "1", not "01").
The conversion should be performed separately on the hours, minutes, and seconds, and the results should be printed in the same order, separated by colons.
For example, converting the time 12:34:56
would yield:
\[ 12_{10} = 1100_2, \quad 34_{10} = 100010_2, \quad 56_{10} = 111000_2 \]
Thus, the final output is 1100:100010:111000
.
inputFormat
The first line of input contains a single integer n
representing the number of time strings to convert. Each of the next n
lines contains a valid time string in the format HH:MM:SS
.
outputFormat
For each time string given in the input, output a line containing the binary time format with the binary representations of hours, minutes, and seconds separated by colons.
## sample1
12:34:56
1100:100010:111000