#C9626. Meeting Scheduler
Meeting Scheduler
Meeting Scheduler
You are given \(T\) test cases. In each test case, there are \(n\) meetings, each with a start time and an end time. Determine if a person can attend all the meetings without any overlaps.
Two meetings do not overlap if the start time of meeting \(i\) is not less than the end time of meeting \(i-1\), i.e., \(s_i \ge e_{i-1}\). Otherwise, if \(s_i < e_{i-1}\), the meetings overlap.
The input is given through stdin and the output should be printed to stdout.
inputFormat
The input is read from stdin and has the following format:
- An integer \(T\) representing the number of test cases.
- For each test case:
- An integer \(n\) denoting the number of meetings.
- \(n\) lines follow, each containing two space-separated integers \(s\) and \(e\) (the start time and end time of a meeting).
outputFormat
For each test case, print a single line containing "YES" if all the meetings can be attended without any overlaps, otherwise print "NO". The output should be sent to stdout.
## sample4
3
300 400
700 800
1200 1300
3
300 700
500 800
900 1000
2
0 1440
1440 2400
2
450 600
900 1100
YES
NO
YES
YES
</p>