#d1803. 排列

排列

Permutation

Problem Description

There are NN knights, with initial attack powers a1,a2,…,ana_1, a_2, \dots, a_n. Each knight also has a buff ability bib_i.

For each knight, he will choose some other knight (not himself) and increase that knight's attack power by bib_i.

Determine whether there exists a permutation of the knights such that, no matter how each knight chooses the target of his buff, the attack powers of the knights are non-increasing from left to right.

Input Format

The first line contains a positive integer TT, the number of test cases.

For each test case, the first line contains a positive integer NN, the number of knights.

Each of the next NN lines contains two integers: the ii-th line contains aia_i and bib_i, the initial attack power and buff ability of knight ii.

Output Format

For each test case, if there exists a permutation of the knights satisfying the requirement, output Yes; otherwise output No.

Sample Input

3
2
15 25
10 5
3
7 0
7 3
10 0
3
10 10
20 20
30 30

Sample Output

Yes
Yes
No

Sample Explanation

For the first test case, since N=2N = 2, the final attack powers must be 3535 and 2020. It is clearly possible.

For the second test case, we can arrange the knights as 10,7,710, 7, 7, placing the knight with buff ability 33 last. Then no matter how the knight with buff ability 33 chooses, the requirement is satisfied.

For the third test case, it can be proven that no arrangement satisfies the requirement, so output No.

Constraints

For all data, 1≤T≤10001 \le T \le 1000, 2≤N≤1002 \le N \le 100, and 0≤ai,bi≤1060 \le a_i, b_i \le 10^6.