Time Card
InterviewTime limit1sMemory limit128 MB
Given clock-in and clock-out times for three employees in h m s form, print each employee's working duration as hours, minutes, and seconds.
- Level
Easy2 of 10
- Topics
- Math, Implementation, Simulation
- Solved
- No attempts yet
Problem
A company tracks its employees' working hours with time cards. When an employee arrives, they record their clock-in time on the time card; when they leave, they record their clock-out time. Times use the 24-hour clock.
For security reasons, every employee clocks in at or after 7 o'clock, and every employee clocks out before 23 o'clock. Also, the clock-out time is always later than the clock-in time.
Given the clock-in and clock-out times of three employees A, B, and C, write a program that computes each employee's working time.
Input
The input consists of three lines.
- The first line contains employee A's clock-in time and clock-out time,
- the second line contains employee B's clock-in time and clock-out time,
- the third line contains employee C's clock-in time and clock-out time.
Each time is written as three space-separated integers , , , meaning hours minutes seconds. (, , )
Thus each line contains six space-separated integers: the clock-in time followed by the clock-out time.
Output
Print three lines.
- The first line contains employee A's working time,
- the second line contains employee B's working time,
- the third line contains employee C's working time.
If the working time is hours minutes seconds, print , , separated by spaces in that order.