#C9942. Event Scheduling
Event Scheduling
Event Scheduling
You are given (n) scheduled events. Each event is represented by a pair of integers ((s, e)) denoting the start and end times, where (s < e). You are also given a new event represented as a pair ((s', e')). The task is to determine if the new event can be scheduled without overlapping any of the (n) existing events. Two events are considered non-overlapping if (e' \leq s) or (s' \geq e). Output "Yes" if the new event can be scheduled; otherwise, output "No".
inputFormat
The input is read from standard input and follows the format below:
- The first line contains a single integer (n), representing the number of scheduled events.
- The next (n) lines each contain two space-separated integers (s) and (e), representing the start and end times of an event.
- The last line contains two space-separated integers (s') and (e'), representing the new event's start and end times.
outputFormat
Output a single line to standard output containing "Yes" if the new event can be scheduled without overlapping any existing events, otherwise "No".## sample
1
1 5
6 10
Yes
</p>