TV Schedule
The new channel «6+6» has recently skyrocketed in popularity. Major companies, which we'll call A, B, and C, are offering substantial sums to secure a prime time slot for their programs. These programs, while engaging, contain subtle advertisements. The channel's management is worried that the broadcast times for these programs might overlap. Unable to solve this issue themselves, they have enlisted the help of Andriy, who is developing a program to address it.
Each broadcast time is specified by four integers: the start and end hours and minutes. All input data is valid, with hours ranging from 0 to 23 and minutes from 0 to 59. The end time is always later than the start time. Broadcast times are considered overlapping if they coincide for at least one minute. The program should determine if the broadcast times for A, B, and C overlap and output a specific message:
- 0: No overlap among the broadcast times. - 1: Only A and B overlap. - 2: Only A and C overlap. - 3: A overlaps with both B and C, but B and C do not overlap with each other. - 4: Only B and C overlap. - 5: B overlaps with both A and C, but A and C do not overlap with each other. - 6: C overlaps with both A and B, but A and B do not overlap with each other. - 7: All three broadcasts overlap at some common time. - 8: Any other overlapping scenario.
Let's create a program to solve this!
Input
Each of the next three lines contains four integers representing the start and end times (hours and minutes) for the broadcasts of companies A, B, and C, respectively.
Output
The program should output a message according to the rules specified above.