Chef is an advocate for Go Green Initiative. Today he had n trees planted in a row outside his his restaurant. Today, the height of i-th tree is hi feet. The trees grow at a rate of mi feet per day.
Chef knows that trees will look beautiful if they form a zig-zag sequence. The trees will be said to be in Zig-zag sequence if the heights of tree first increases or decreases, then alternates between decreasing/increasing respectively. Formally, the trees will be said to in Zig-zag sequence if one of the following two conditions holds.

- h1 < h2 > h3 < h4 and so on..
- h1 >  h2 < h3 > h4 and so on..

Chef wants to know intervals of time when the heights of the trees will form a zig-zag sequence.

-----Input-----
The first line of the input contains an integer T denoting the number of test cases. The description of T test cases follows.
The first line of each test case contains a single integer n, denoting the number of trees.
The ith of following N lines contains two space separated integers hi and mi, denoting the initial height and the growth speed for ith tree.

-----Output-----
For each test case, output an integer Q - the amount of the periods of consecutive moments of time, when the trees for a zig-zag sequence.
On the following Q lines, output the intervals of time when the trees' heights form a zig-zag sequence. For each intervals, output its' smallest and the largest instants of time. If the range is infinite, output Inf as the right bound.
The test cases are designed in such a way that the total output won't exceed 2 MB.

-----Constraints-----

- 1 ≤ T ≤ 105
- 1 ≤ n ≤ 10
- Subtask 1 (23 points): 0 ≤ hi, mi ≤ 10
- Subtask 2 (77 points): 0 ≤ hi, mi ≤ 109
- 1 ≤ sum of n over a test cases in a single test file ≤ 5 × 105

-----Example-----
Input:3
3
0 1
2 2
0 3
2
2 1
1 2
3
1 1
2 2
3 3

Output:1
0 1
2
0 0
2 Inf
0

-----Explanation-----
Example case 1. In the first case 0 2 0 is already a zig-zag sequence, but on the 2nd second it will become 2 6 6 and will never turn back into zig-zag

```python

USER_FILENAME = "<user_code>"
import sys, json, builtins
import math, heapq, bisect, itertools, functools, collections, statistics, fractions, decimal, operator, array, random, re, string, os, pathlib
try:
    import resource as _res
except Exception:
    _res = None
from collections import Counter, defaultdict, deque, OrderedDict
from functools import lru_cache, reduce
from itertools import accumulate, permutations, combinations, product
from math import gcd, ceil, floor, sqrt
from decimal import Decimal
try:
    from typing import *
except Exception:
    pass
try:
    sys.setrecursionlimit(1_000_000)
except Exception:
    pass
try:
    import site as _site
    try:
        _sys_sites = _site.getsitepackages() if hasattr(_site, "getsitepackages") else []
        for _p in _sys_sites:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
    try:
        _usp = _site.getusersitepackages()
        if isinstance(_usp, str):
            _usp = [_usp]
        for _p in _usp:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
except Exception:
    pass

ns = {"__name__": "__main__"}
for _k, _v in list(globals().items()):
    if not _k.startswith("_"):
        ns[_k] = _v
_CODE = 'import math\ndef CHAHG1(xh,m):\n x = [x for x in xh]\n y = [y for y in m]\n\n up = []\n lw = []\n L = None\n R = None\n for i in range(0,len(x)-1):\n  if(i%2==0):\n   if((y[i]-y[i+1])==0):\n    if(x[i] < x[i+1]):\n     lw.append(0)\n    else:\n     return False\n   else:\n    if(y[i] < y[i+1]):\n     l = (float)(x[i+1]-x[i])/(y[i]-y[i+1])\n     l = int(math.floor(l))+1\n     lw.append(max(0,l))\n    else:\n     r = (float)(x[i+1]-x[i])/(y[i]-y[i+1])\n     r = int(math.ceil(r))-1\n     if(r<0):\n      return False\n     up.append(r)\n  else:\n   if((y[i]-y[i+1])==0):\n    if(x[i] > x[i+1]):\n     lw.append(0)\n    else:\n     return False\n   else:\n    if(y[i] > y[i+1]):\n     l = (float)(x[i+1]-x[i])/(y[i]-y[i+1])\n     l = int(math.floor(l))+1\n     lw.append(max(0,l))\n    else:\n     r = (float)(x[i+1]-x[i])/(y[i]-y[i+1])\n     r = int(math.ceil(r))-1\n     if(r<0):\n      return False\n     up.append(r)\n if(len(lw)>0):\n  L = max(lw)\n else:\n  L = 0\n if(len(up) > 0):\n  R = min(up)\n  if(L>R):\n   return False\n else:\n  R = "Inf"\n\n return L,R\n\ndef CHAHG2(xh,m):\n x = [x for x in xh]\n y = [y for y in m]\n up = []\n lw = []\n L = None\n R = None\n for i in range(0,len(x)-1):\n  if(i%2==1):\n   if((y[i]-y[i+1])==0):\n    if(x[i] < x[i+1]):\n     lw.append(0)\n    else:\n     return False\n   else:\n    if(y[i] < y[i+1]):\n     l = (float)(x[i+1]-x[i])/(y[i]-y[i+1])\n     l = int(math.floor(l))+1\n     lw.append(max(0,l))\n    else:\n     r = (float)(x[i+1]-x[i])/(y[i]-y[i+1])\n     r = int(math.ceil(r))-1\n     if(r<0):\n      return False\n     up.append(r)\n  else:\n   if((y[i]-y[i+1])==0):\n    if(x[i] > x[i+1]):\n     lw.append(0)\n    else:\n     return False\n   else:\n    if(y[i] > y[i+1]):\n     l = (float)(x[i+1]-x[i])/(y[i]-y[i+1])\n     l = int(math.floor(l))+1\n     lw.append(max(0,l))\n    else:\n     r = (float)(x[i+1]-x[i])/(y[i]-y[i+1])\n     r = int(math.ceil(r))-1\n     if(r<0):\n      return False\n     up.append(r)\n if(len(lw)>0):\n  L = max(lw)\n else:\n  L = 0\n if(len(up) > 0):\n  R = min(up)\n  if(L>R):\n   return False\n else:\n  R = "Inf"\n\n return L,R\n\nT = int(input())\nwhile T:\n T = T-1\n N = int(input())\n xh = []\n m = []\n for i in range(N):\n  a,b = list(map(int,input().split()))\n  xh.append(a)\n  m.append(b)\n\n res = []\n p = CHAHG1(xh,m)\n q = CHAHG2(xh,m)\n if(p is not False):\n  res.append(p)\n if(q is not False):\n  res.append(q)\n  \n res.sort()\n sz = len(res)\n\n if(N==1):\n  print("1")\n  print("0 Inf")\n else:\n  if(sz==2 and res[0][1] >= res[1][0]):\n   print("0")\n  elif(sz==2 and (res[0][1]+1 == res[1][0])):\n   print("1")\n   print(res[0][0],res[1][1])\n  else:\n   print(sz)\n   for L,R in res:\n    print(L,R)\n'
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

```

Measured memory_bytes: 13989