#C703. Overlapping Events

    ID: 50856 Type: Default 1000ms 256MiB

Overlapping Events

Overlapping Events

You are given the employment period of an employee and a list of events, each with a start and end date in the format \(\texttt{YYYY-MM-DD}\). Your task is to output the names of the events that overlap with the employee's employment period. An event is said to overlap if its date range intersects with the employment period (i.e. its end date is not earlier than the employee's start date and its start date is not later than the employee's end date).

If no event overlaps with the employment period, print "No Overlapping Events".

Input will be provided via standard input (stdin) and output must be printed to standard output (stdout).

inputFormat

The input consists of space-separated tokens. The first two tokens represent the employee's start date and end date, respectively. The remaining tokens form groups of three that represent each event:

  • Event name (a single word)
  • Event start date (\(YYYY-MM-DD\))
  • Event end date (\(YYYY-MM-DD\))

There is at least one event provided.

outputFormat

Print the names of all events that overlap with the employee's employment period, each on a new line. If there are no overlapping events, output exactly "No Overlapping Events".

## sample
2023-01-15 2023-12-31 CompanyPicnic 2023-07-04 2023-07-04 AnnualMeeting 2023-11-01 2023-11-03 Hackathon 2024-01-10 2024-01-12
CompanyPicnic

AnnualMeeting

</p>