Polycarp has recently created a new level in this cool new game Berlio Maker 85 and uploaded it online. Now players from all over the world can try his level.

All levels in this game have two stats to them: the number of plays and the number of clears. So when a player attempts the level, the number of plays increases by $1$. If he manages to finish the level successfully then the number of clears increases by $1$ as well. Note that both of the statistics update at the same time (so if the player finishes the level successfully then the number of plays will increase at the same time as the number of clears).

Polycarp is very excited about his level, so he keeps peeking at the stats to know how hard his level turns out to be.

So he peeked at the stats $n$ times and wrote down $n$ pairs of integers — $(p_1, c_1), (p_2, c_2), \dots, (p_n, c_n)$, where $p_i$ is the number of plays at the $i$-th moment of time and $c_i$ is the number of clears at the same moment of time. The stats are given in chronological order (i.e. the order of given pairs is exactly the same as Polycarp has written down).

Between two consecutive moments of time Polycarp peeked at the stats many players (but possibly zero) could attempt the level.

Finally, Polycarp wonders if he hasn't messed up any records and all the pairs are correct. If there could exist such a sequence of plays (and clears, respectively) that the stats were exactly as Polycarp has written down, then he considers his records correct.

Help him to check the correctness of his records.

For your convenience you have to answer multiple independent test cases.


-----Input-----

The first line contains a single integer $T$ $(1 \le T \le 500)$ — the number of test cases.

The first line of each test case contains a single integer $n$ ($1 \le n \le 100$) — the number of moments of time Polycarp peeked at the stats.

Each of the next $n$ lines contains two integers $p_i$ and $c_i$ ($0 \le p_i, c_i \le 1000$) — the number of plays and the number of clears of the level at the $i$-th moment of time.

Note that the stats are given in chronological order.


-----Output-----

For each test case print a single line.

If there could exist such a sequence of plays (and clears, respectively) that the stats were exactly as Polycarp has written down, then print "YES".

Otherwise, print "NO".

You can print each letter in any case (upper or lower).


-----Example-----
Input
6
3
0 0
1 1
1 2
2
1 0
1000 3
4
10 1
15 2
10 2
15 2
1
765 432
2
4 4
4 3
5
0 0
1 0
1 0
1 0
1 0

Output
NO
YES
NO
YES
NO
YES



-----Note-----

In the first test case at the third moment of time the number of clears increased but the number of plays did not, that couldn't have happened.

The second test case is a nice example of a Super Expert level.

In the third test case the number of plays decreased, which is impossible.

The fourth test case is probably an auto level with a single jump over the spike.

In the fifth test case the number of clears decreased, which is also impossible.

Nobody wanted to play the sixth test case; Polycarp's mom attempted it to make him feel better, however, she couldn't clear it.

Difficulty: interview

Starter code:

Solutions:
import sys
input = sys.stdin.readline

T = int(input())
for _ in range(T):
    n = int(input())
    lastP = 0
    lastC = 0
    works = True
    for _ in range(n):
        p, c = list(map(int, input().split()))
        pDiff = p-lastP
        cDiff = c-lastC
        if 0 <= cDiff <= pDiff:
            pass
        else:
            works = False
        lastP = p
        lastC = c
    if works:
        print('YES')
    else:
        print('NO')


import sys
from math import gcd
from collections import defaultdict
from copy import copy

R = lambda t = int: t(input())
RL = lambda t = int: [t(x) for x in input().split()]
RLL = lambda n, t = int: [RL(t) for _ in range(n)]

def solve():
  n = R()
  S = RLL(n)
  lp = lc = 0
  for p, c in S:
    if lp > p or lc > c or c - lc > p - lp:
      print('NO')
      return
    lp = p
    lc = c
  print('YES')
      

T = R()
for _ in range(T):
  solve()


for tc in range(int(input())):
    n = int(input())
    am,bm = 0,0
    res = 'YES'
    for i in range(n):
        a,b = list(map(int, input().split()))
        if a<am or b<bm or (a-b)<(am-bm):
            res='NO'
        am, bm = a,b
    print(res)


from math import *

for zz in range(int(input())):
    n = int(input())
    p1, c1 = list(map(int, input().split()))
    ha = True
    if p1 < c1:
        ha = False

    for i in range(n - 1):
        p, c = list(map(int, input().split()))
        if (p - p1 < c - c1) or p < p1 or c < c1:
            ha = False
        p1 = p
        c1 = c
    
    if ha:
        print("YES")
    else:
        print("NO")


t=int(input())
for _ in range(t):
    n=int(input())
    c,d=0,0
    bo=0
    for i in range(n):
        a,b=list(map(int,input().split()))
        if(a<c or b<d):
            bo=1
        elif(a-c<b-d):
            bo=1
        c,d=a,b
    if(bo):
        print("NO")
    else:
        print("YES")


from collections import *
import sys
try: inp = raw_input
except: inp = input
def err(s):
    sys.stderr.write('{}\n'.format(s))

def ni():
    return int(inp())

def nl():
    return [int(_) for _ in inp().split()]

T = ni()
for _ in range(T):
    N = ni()
    lp, lc = 0, 0
    fail = False
    for _ in range(N):
        p, c = nl()
        dp = p - lp
        dc = c - lc
        lp, lc = p, c
        if dp < dc or dc < 0:
            fail = True
    if fail:
        print('NO')
    else:
        print('YES')
    



for _ in range(int(input())):
    p1 = 0
    c1 = 0
    flag = True
    for _ in range(int(input())):
        p2, c2 = list(map(int, input().split()))
        if not flag:
            continue
        if p2 < p1 or c2 < c1:
            flag = False
        if p2-p1 < c2-c1:
            flag = False
        p1 = p2
        c1 = c2
    if flag:
        print("YES")
    else:
        print("NO")


def main():
    n = int(input())
    pl, cl = 0, 0
    correct = True
    for i in range(n):
        p, c = list(map(int, input().split()))
        if c - cl > p - pl:
            correct = False
        if c < cl:
            correct = False
        if p < pl:
            correct = False
        pl, cl = p, c

    if correct:
        print("YES")
    else:
        print("NO")


t = int(input())
for _ in range(t):
    main()


for ahfiuyh in range(int(input())):
    n = int(input())
    a = [list(map(int,input().split())) for i in range(n)]
    cc = [0,0]
    f = True
    for i in a:
        if i[1] > i[0]:
            print("NO")
            f = False
            break
        elif i[0] < cc[0]:
            print("NO")
            f = False
            break
        elif i[1] < cc[1]:
            print("NO")
            f = False
            break
        elif i[1] - cc[1] > i[0] - cc[0]:
            print("NO")
            f = False
            break
        cc = i
    if f:
        print("YES")