#C331. Finding Unique Meeting Room Time Slots

    ID: 46723 Type: Default 1000ms 256MiB

Finding Unique Meeting Room Time Slots

Finding Unique Meeting Room Time Slots

You are given the availability details of several meeting rooms. Each room has one or more available time slots represented as a pair of times in the (HH:MM) format. Your task is to collect all the unique time slots when at least one meeting room is available and output them in ascending order.

For example, if Room1 is available during 09:00–10:00 and 11:00–12:00, and Room2 is available during 09:00–10:00 and 13:00–14:00, then the unique available time slots are
(09:00)–(10:00), (11:00)–(12:00), and (13:00)–(14:00).

inputFormat

The input is read from standard input (stdin) and has the following format:

1. The first line contains an integer (N) representing the number of meeting rooms.
2. For each meeting room, there is a line that contains the room name (a string without spaces) and an integer (M) denoting the number of available time slots.
3. Following that, there are (M) lines for that room. Each line contains two strings representing the start and end time of a slot in the format (HH:MM).

outputFormat

Print all unique available time slots in ascending order. Each line of the output (stdout) should contain the start and end time separated by a space. If there are no meeting rooms provided (i.e. (N=0)), the program should output nothing.## sample

3
Room1 2
09:00 10:00
11:00 12:00
Room2 2
09:00 10:00
13:00 14:00
Room3 2
12:00 13:00
14:00 15:00
09:00 10:00

11:00 12:00 12:00 13:00 13:00 14:00 14:00 15:00

</p>