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 is_zig_zag(h):\n if len(h) < 2:\n  return True\n if h[0] == h[1]:\n  return False\n fs = (lambda x, y: x < y, lambda x, y: x > y)\n f = 0 if h[0] < h[1] else 1\n for i in range(1, len(h)-1):\n  if not fs[(i+f)%2](h[i], h[i+1]):\n   return False\n return True\ndef t_diff(h, m):\n max_t_diff = None\n for i in range(len(h)-1):\n  h_diff, m_diff = h[i]-h[i+1], m[i]-m[i+1]\n  if h_diff == m_diff or m_diff == 0:\n   continue\n  if h_diff == 0:\n   return 1\n  if (h_diff < 0) != (m_diff < 0):\n   local_t_diff = max(1, abs(h_diff/m_diff))\n   if max_t_diff is None:\n    max_t_diff = local_t_diff\n   else:\n    max_t_diff = min(max_t_diff, local_t_diff)\n return max_t_diff\nfor _ in range(eval(input())):\n n = eval(input())\n h, m = list(map(list, list(zip(*[list(map(int, input().split())) for _ in range(n)]))))\n t = 0\n zig_zags = []\n zig_zag_start = None\n while True:\n  if is_zig_zag(h):\n   if zig_zag_start is None:\n    zig_zag_start = t\n  elif zig_zag_start is not None:\n   zig_zags.append((zig_zag_start, t-1))\n   zig_zag_start = None\n  td = t_diff(h, m)\n  if td is None:\n   if zig_zag_start is not None:\n    zig_zags.append((zig_zag_start, 'Inf'))\n    zig_zag_start = None\n   break\n  h = list(map(lambda x, y: x+td*y, h, m))\n  t += td\n print(len(zig_zags))\n for s, e in zig_zags:\n  print(s, e)"
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

```

Measured memory_bytes: 20485