There are $$$n$$$ SWERC candidates in USI and we are going to hold a contest for them. Each of the candidates has a consecutive free period to do the contest. For the $$$i$$$-th candidate, he/she is available from the $$$l_i$$$-th slot to $$$r_i$$$-th slot. The question is, is there a slot that everyone is free so we can do the contest at that time?
The first line contains an integer $$$T(1 \le T \le 10^3)$$$ — the number of test cases. The description of the test cases follows.
For each test case, the first line contains an integer $$$n(1 \le n \le 10^3)$$$ — the number of candidates.
The next $$$n$$$ lines contains two integers $$$l_i,r_i(1 \le l_i \le r_i \le 10^3)$$$ — the free time period of $$$i$$$-th candidate.
It is guaranteed that $$$\sum n \le 10^3$$$ for all test cases.
For each test case, print "YES"(without quotes) in a line if there is at least one slot in which every candidate is available. Otherwise, print "NO"(without quotes) in a line.
You can output "YES" and "NO" in any case (for example, strings "yES", "yes" and "Yes" will be recognized as a positive response).
231 31 22 331 22 33 4
YES NO
For the first test case in the sample, everyone is available at slot $$$2$$$.
For the second test case in the sample, there's no slot that everyone is available.