#C10117. Meeting Room Scheduling

    ID: 39287 Type: Default 1000ms 256MiB

Meeting Room Scheduling

Meeting Room Scheduling

You are given a schedule of meeting rooms and their booked time slots for the day. Each meeting room has several bookings in a 24-hour format (HH:MM). Given a requested time slot for a new meeting, your task is to determine the first available meeting room (in alphabetical order) that does not have any time conflict with the requested slot. Two time slots are considered to be in conflict if they overlap. However, if one meeting ends exactly when another starts, they do not conflict.

If no meeting room is available, return "No meeting room available".

The time comparison should be done using the standard 24-hour time format where times are provided as zero-padded strings. Formally, given a booked slot \([s_1, e_1]\) and a requested slot \([s_2, e_2]\), they conflict if:

\[ \text{not} \; \Big( e_1 \leq s_2 \quad \text{or} \quad e_2 \leq s_1 \Big). \]

inputFormat

The input begins with an integer R representing the number of meeting rooms. For each meeting room, the input has the following:

  1. A string denoting the meeting room name.
  2. An integer S denoting the number of booked time slots for that room.
  3. S lines each containing two strings representing the start and end times of a booking (in HH:MM format).

After the meeting room details, there is a line with two strings representing the requested slot's start and end times.

outputFormat

Output the name of the first available meeting room (based on alphabetical order) that can accommodate the requested time slot. If none of the meeting rooms are available, output "No meeting room available".

## sample
3
RoomA
2
09:00 10:00
11:00 12:30
RoomB
2
08:00 09:30
12:00 13:00
RoomC
3
09:00 10:00
10:30 12:00
14:00 15:00
10:00 11:00
RoomA