There are already 10 A + B questions on HDOJ. I believe these questions were once everyone ’s favorite. I hope that this A + B today will bring good luck to everyone. I also hope that this question will evoke everyone’s concerns about ACM Love.
A and B in this topic are not simple integers, but two times. A and B are composed of 3 integers, which represent hours, minutes, and seconds. For example, if A is 34 45 56, it means that the time represented by A is 34 hours, 45 minutes, and 56 seconds.
The input data consists of multiple lines. First is an integer N, which represents the number of test instances, and then N rows of data. Each line has 6 integers AH, AM, AS, BH, BM, BS, which represent the times A and B, respectively. The corresponding hour, minute, and second. The title guarantees that all data is legal.
For each test instance, output A + B. Each output result is also composed of 3 hours, minutes, and seconds. At the same time, the rules of time must be met (that is, the range of minutes and seconds is 0 ~ 59). One line, and all parts can be represented by 32-bit integers.
1 | 2 |
1 | 5 7 9 |
Just stimulate the rule of clock time addition.
1 |
|