#K9011. Meeting Scheduler
Meeting Scheduler
Meeting Scheduler
You are given the availability of n participants in the form of n time intervals. Each interval is represented by two integers indicating the start and end times. Your task is to determine whether there exists a common time period during which all participants are available.
Please note that the common time period is valid only if the intersection of all intervals has a positive duration. In other words, if the maximum of the start times is strictly less than the minimum of the end times (i.e. if \(\max(start_i) < \min(end_i)\)), then a common time period exists.
inputFormat
The first line of input contains a single integer n representing the number of participants.
The following n lines each contain two integers, start and end, denoting the start and end times of a participant's availability.
You may assume that 0 \(\leq start < end \leq 10^9\).
outputFormat
Output a single line with the word yes
if there exists a common time period for all participants, and no
otherwise.
3
1 5
2 6
3 8
yes
</p>