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 random import *\n\ndef check(h):\n ans = True\n for i in range(n-1):\n  if (i%2 == 0):\n   if (h[i] < h[i+1]):\n    ans = True\n   else:\n    ans = False\n    break\n  else:\n   if (h[i] > h[i+1]):\n    ans = True\n   else:\n    ans = False\n    break\n if (ans == True):\n  return 1\n \n ans = True\n for i in range(n-1):\n  if (i%2 == 1):\n   if (h[i] < h[i+1]):\n    ans = True\n   else:\n    ans = False\n    break\n  else:\n   if (h[i] > h[i+1]):\n    ans = True\n   else:\n    ans = False\n    break\n if (ans == True):\n  return 1\n\n return 0\n \nfor t in range(int(input())):\n n = int(input())\n h = []\n r = []\n for i in range(n):\n  #x, y = randint(1,10), randint(1,10)\n  x, y = list(map(int, input().split()))\n  h.append(x)\n  r.append(y)\n\n ans = []\n curr = check(h)\n\n #print h\n #print r\n \n if (curr != 0):\n  ans.append(0)\n  \n #print 0, ":", "x", h, curr\n for i in range(1, 20):\n  for j in range(n):\n   h[j] += r[j]\n  temp = check(h)\n  #print i, ":", curr, h, temp\n  if (temp != curr):\n   if (temp == 0):\n    ans.append(i-1)\n   elif (temp == 1 and curr == 0):\n    ans.append(i)\n   elif (temp == 2 and curr == 0):\n    ans.append(i)\n   elif (temp == 1 and curr == 2):\n    ans.append(i-1)\n    ans.append(i)\n   elif (temp == 2 and curr == 1):\n    ans.append(i-1)\n    ans.append(i)\n  curr = temp\n  if (len(ans)== 3):\n   break\n if (len(ans)%2==1):\n  ans.append(\'Inf\')\n  \n print(len(ans)/2)\n for i in range(0, len(ans), 2):\n  print(ans[i], ans[i+1])\n \n'
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

```

Measured memory_bytes: 14151