B. Solo Leveling
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output
It is not in the stars to hold our destiny but in ourselves.
— William Shakespeare, Julius Caesar

You are playing a computer game. To pass the current level, you need to kill all monsters solo.

As a Player, your power is quantified in two properties $$$A$$$ and $$$B$$$.

In this level, there are $$$n$$$ monsters. The $$$i$$$-th monster has two properties $$$a_i$$$ and $$$b_i$$$. To kill the $$$i$$$-th monster, you need more power correspondingly, i.e. $$$A \geq a_i$$$ and $$$B \geq b_i$$$.

Note that different monsters can have the same properties.

The Designer limits your initial properties and gives you ways below to promote them.

Initially, your properties are $$$A=10, B=10$$$. If you killed the $$$i$$$-th monster, you'll get exactly $$$c_i$$$ distributable points. Each point can promote exactly one property by $$$1$$$ forever, i.e. $$$A := A + 1$$$ or $$$B := B + 1$$$. You can use these points at any time, but each point can be used only once.

Now you can kill the monsters in any order, determine whether you can kill them all.

Input

The first line contains a single integer $$$t$$$ $$$(1 \leq t \leq 10^3)$$$, denoting the number of test cases.

The first line of each test case contains a single integer $$$n$$$ $$$(1 \leq n \leq 10 ^ 3)$$$, denoting the number of monsters.

The $$$i$$$-th of the next $$$n$$$ lines contains three integers $$$a_i, b_i, c_i$$$ $$$(1 \leq a_i, b_i, c_i \leq 10 ^ 9)$$$, denoting the two properties of the $$$i$$$-th monster and the distributable points you will get after killing the $$$i$$$-th monster.

It's guaranteed that the sum of $$$n$$$ over all test cases doesn't exceed $$$4 \times 10 ^ 3$$$.

Output

For each test case, print Yes if you can kill monsters in some order. Otherwise, print No.

You may print each letter in any case. For example, YES, yes, Yes will all be recognized as positive answer, NO, no, nO will all be recognized as negative answer.

Example
Input
4
1
11 11 2
3
1 1 1
2 2 2
3 3 3
4
8 8 1
11 10 1
11 10 1
11 12 1
4
1 5 10
20 32 1
10 22 10
20 10 12
Output
No
Yes
Yes
Yes
Note

In the first test case, there is only one monster. If you want to kill it, you must at least promote your properties to $$$A=11, B=11$$$, but obviously you can't. You can not get $$$c_1$$$ before killing it.

In the second test case, all the monsters are weaker than your initial properties $$$A=10, B=10$$$, so you can kill them all in any order.

In the third test case, you can kill the monsters in the order of the input.

In the fourth test case, one possible order is:

  1. Kill the $$$1$$$-st monster, and use all the points you get to promote $$$A$$$. After that, $$$A=20, B=10$$$.
  2. Kill the $$$4$$$-th monster, and use all the points you get to promote $$$B$$$. After that, $$$A=20, B=22$$$.
  3. Kill the $$$3$$$-rd monster, and use all the points you get to promote $$$B$$$. After that, $$$A=20, B=32$$$.
  4. Kill the $$$2$$$-nd monster, and you can pass the level.