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 = 'def get(l,n):\n l1,l2 = [],[]\n i = 1\n h1,m1 = l[0]\n while (i < len(l)):\n  h2,m2 = l[i]\n  if (h1>h2):\n   if (m1 >= m2):\n    l1 += [(0,10**20)]\n    l2 += [(-1,-1)]\n   else:\n    d = (h1-h2)//(m2-m1)\n    if (((h1-h2)%(m2-m1)) == 0):\n     l1 += [(0,d-1)]\n     l2 += [(d+1,10**20)]\n    else:\n     l1 += [(0,d)]\n     l2 += [(d+1,10**20)]\n  elif(h1==h2):\n   if (m1 > m2):\n    l1 += [(1,10**20)]\n    l2 += [(-1,-1)]\n   elif(m1==m2):\n    l1 += [(-1,-1)]\n    l2 += [(-1,-1)]\n   else:\n    l2 += [(1,10**20)]\n    l1 += [(-1,-1)]\n  else:\n   if (m1 <= m2):\n    l2 += [(0,10**20)]\n    l1 += [(-1,-1)]\n   else:\n    d = (h2-h1)//(m1-m2)\n    if ((h2-h1)%(m1-m2) == 0):\n     l2 += [(0,d-1)]\n     l1 += [(d+1,10**20)]\n    else:\n     l2 += [(0,d)]\n     l1 += [(d+1,10**20)]\n  i += 1\n  h1,m1 = h2,m2\n return l1,l2\n \ndef intersect(k1,k2):\n k1,k2 = min(k1,k2),max(k1,k2)\n c1,c2 = k1\n c3,c4 = k2\n l = [c1,c2,c3,c4]\n l.sort()\n if (l[2]==c2):\n  return (c3,min(c2,c4))\n elif (l[3]==c2):\n  return k2\n else:\n  return (-1,-1)\n \n \n \ndef union(k1,k2):\n k1,k2 = min(k1,k2),max(k1,k2)\n c1,c2 = k1\n c3,c4 = k2\n l = [c1,c2,c3,c4]\n l.sort()\n if (c2==l[3]):\n  return ([c1,c2])\n elif(c2==l[2] or ((c3-c2) == 1)):\n  return([c1,c4])\n else:\n  return([c1,c2,c3,c4])\n \n \ndef aa(l1,l2,n):\n c1,c2 = 0,10**20\n i = 0\n n -= 1\n while (i < n):\n  if (i%2 == 0):\n   k1,k2 = l1[i]\n  else:\n   k1,k2 = l2[i]\n  i += 1\n  if ((k1,k2) == (-1,-1)):\n   return (-1,-1)\n  c1,c2 = intersect((c1,c2),(k1,k2))\n  if ((c1,c2) == (-1,-1)):\n   return (c1,c2)\n return (c1,c2)\n \n \ntest = int(input())\nwhile (test != 0):\n test -= 1\n n = int(input())\n l = []\n i = 0\n while (i < n):\n  c1,c2 = list(map(int,input().split()))\n  l += [(c1,c2)]\n  i += 1\n if (n == 1):\n  print(1)\n  print("0 Inf")\n else:\n  l1,l2 = (get(l,n))\n  k1,k2 = aa(l1,l2,n)\n  if ((k1,k2) == (-1,-1)):\n   k1,k2 = aa(l2,l1,n)\n   if ((k1,k2) == (-1,-1)):\n    print(0)\n   else:\n    print(1)\n    if (k2 == 10**20):\n     k2 = "Inf"\n    print(str(k1) + " " +str(k2))\n  else:\n   k3,k4 = aa(l2,l1,n)\n   if ((k3,k4) == (-1,-1)):\n    print(1)\n    if (k2 == 10**20):\n     k2 = "Inf"\n    print(str(k1) + " " +str(k2))\n   else:\n    p = union((k1,k2),(k3,k4))\n    if (len(p)==2):\n     c1,c2 = p\n     if (c2==10**20):\n      c2 = "Inf"\n     print(1)\n     print(str(c1) + " " +str(c2))\n    else:\n     c1,c2,c3,c4 = p\n     if (c4 == 10**20):\n      c4 = "Inf"\n     print(2)\n     print(str(c1) + " " +str(c2))\n     print(str(c3) + " " +str(c4))\n'
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

```

Measured memory_bytes: 14495