#K61187. Event Conflict Detection

    ID: 31254 Type: Default 1000ms 256MiB

Event Conflict Detection

Event Conflict Detection

You are given a list of time intervals representing scheduled events and a new event interval. Your task is to determine if the new event conflicts with any of the existing events. Two events conflict if their time intervals overlap; that is, for an existing event with start time \(s\) and end time \(e\), and a new event with start time \(s_n\) and end time \(e_n\), a conflict occurs if and only if \(s_n s\).

Read the list of events and the new event from the standard input. Print True if there is a conflict, otherwise print False.

inputFormat

The input is given via standard input (stdin). The first line contains a single integer (n), the number of existing events. Each of the following (n) lines contains two space-separated integers representing the start and end times of an event. The last line contains two space-separated integers which represent the start and end times of the new event.

outputFormat

Output a single line via standard output (stdout) with either True or False indicating whether the new event conflicts with any of the existing events.## sample

3
60 120
150 210
300 360
210 300
False

</p>