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 = 'from math import ceil\nt=int(input())\nrangex1=int(0)\nrangex2=int(0)\nrangey1=int(0)\nrangey2=int(0)\nwhile t>0:\n n = int(input())\n h = [int(0)]*11\n m = [int(0)]*11\n alt = int(-1)\n for i in range(0,n):\n  a,b = input().split(" ")\n  h[i]=int(a)\n  m[i]=int(b)\n\n if n==1:\n  print(\'1\')\n  print(\'0 Inf\')\n else :\n  state = int(1)\n  count =int(0)\n  index= int(0)\n  curtime = int(0)\n  while True:\n   state = 1\n   alt = -1\n   for i in range(1,n):\n    if i==1:\n     if h[i]>h[i-1]: alt=1\n     elif h[i]<h[i-1]: alt=0\n     else:\n      alt=2\n      state=0\n      break\n    elif alt==1:\n     if h[i]<h[i-1]: alt=0\n     else :\n      state=0\n      break\n    else :\n     if h[i]>h[i-1] : alt=1\n     else :\n      state=0\n      break\n\n   if state ==1:\n    count +=1\n    if index==0: rangex1=int(curtime)\n    else : rangex2=int(curtime) \n\n   mintime=int(0)\n   found=int(0)\n   tt=int(0)\n   for i in range(1,n):\n    if h[i-1]<h[i]:\n     if m[i-1]>m[i]:\n      tt = int(ceil(float(h[i]-h[i-1])/float(m[i-1]-m[i])))\n      if found==0:\n       mintime=tt\n       found=1\n      elif tt<mintime:\n       mintime=tt\n    elif h[i-1]>h[i]:\n     if m[i]>m[i-1]:\n      tt=int(ceil(float(h[i-1]-h[i])/float(m[i]-m[i-1])))\n      if found==0:\n       mintime=tt\n       found=1\n      elif tt<mintime:\n       mintime=tt\n    else:\n     if m[i]!=m[i-1]:\n      tt=1\n      if found==0:\n       mintime=tt\n       found=1\n      elif tt<mintime:\n       mintime=tt\n\n   #print found, mintime\n   if found == 0:\n    if state==1:\n     if index==0:\n      rangey1=int(-1)\n      index+=1\n     else :\n      rangey2=int(-1)\n      index+=1\n    break\n   else:\n    if state==1:\n     if index==0:\n      rangey1=int(curtime+mintime-1)\n      index+=1\n     else:\n      rangey2=int(curtime+mintime-1)\n      index+=1\n    \n    curtime+=mintime\n    for i in range(0,n):\n     h[i]+=m[i]*mintime\n\n  if count>1:\n   if rangey1==rangex2-1:\n    rangey1=rangey2\n    count-=1\n\n  print(count)\n  if count>=1:\n   if rangey1==-1:\n    print(\'%d Inf\' %(rangex1))\n   else :\n    print(rangex1, rangey1)\n  if count>=2 :\n   if rangey2==-1:\n    print(\'%d Inf\' %(rangex2))\n   else :\n    print(rangey1, rangey2)\n t-=1\n\n\n\n'
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

```

Measured memory_bytes: 15009