#C11478. Employee Availability Checker

    ID: 40798 Type: Default 1000ms 256MiB

Employee Availability Checker

Employee Availability Checker

You are given the schedules of n employees. Each employee's schedule consists of one or more time intervals during which they are busy, in the format HH:MM-HH:MM. You are also given a query time range defined by a start time and an end time.

An employee is considered available if none of their busy intervals overlap with the query time range. Formally, an interval [s, e) does not overlap with the query interval [start, end) if either \[ end \le s \quad \text{or} \quad start \ge e \] (where the times are in HH:MM format). Your task is to determine the list of employees who are available during the given time range.

Note: Compare the times as strings (since they are zero padded in HH:MM format), which is valid under the given constraints.

inputFormat

The input is given in the following format from standard input (stdin):

  1. The first line contains an integer n representing the number of employees.
  2. The following n blocks describe each employee:
    • The first line of each block contains the employee's name (a string without spaces) and an integer m representing the number of busy intervals.
    • The next m lines each contain a busy interval in the format HH:MM-HH:MM.
  3. The last line contains two strings: start_time and end_time (separated by a space) representing the query time range, where start_time is inclusive and end_time is exclusive.

outputFormat

Output a single line containing the names of all available employees separated by a single space, in the same order as they appear in the input. If no employee is available, output an empty line.

## sample
3
Alice 2
09:00-10:00
12:00-13:00
Bob 2
09:30-10:30
13:00-14:00
Charlie 2
11:00-12:00
14:00-15:00
10:00 11:00
Alice Charlie