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 calc(h, m, f) :\n l, r = 0, 1234567890\n for i in range(len(h) - 1) :\n  if i & 1 : u, v = i, i + 1\n  else : u, v = i + 1, i\n  if f : u, v = v, u\n  H, M = h[u] - h[v], m[v] - m[u]#M * t < H\n  if M > 0 : r = min(int(math.floor(1.0 * H / M - 1e-12)), r)\n  elif M < 0 : l = max(int(math.ceil(1.0 * H / M + 1e-12)), l)\n  elif H <= 0 : return -1, -1\n  if l > r : return -1, -1\n return l, r\ndef printerval(l, r) :\n if r == 1234567890 : r = "Inf"\n print(l, r)\n\ndef doit() :\n n, h, m, a, t, al, ar = int(input()), [], [], [], [0], [], []\n for i in range(n) :\n  h += [0]; m += [0]; a += [0]\n for i in range(n) :\n  h[i], m[i] = list(map(int, input().split()))\n if n == 1 :\n  print(1)\n  print("0 Inf")\n  return\n l1, r1 = calc(h, m, 1)\n l2, r2 = calc(h, m, 0)\n if l1 != -1 and l2 != -1 :\n  if l1 > l2 : l1, l2, r1, r2 = l2, l1, r2, r1\n  if r1 + 1 == l2 :\n   print(1)\n   printerval(l1, r2)\n  else :\n   print(2)\n   printerval(l1, r1)\n   printerval(l2, r2)\n elif l1 != -1 :\n  print(1)\n  printerval(l1, r1)\n elif l2 != -1 :\n  print(1)\n  printerval(l2, r2)\n else : print(0)\n\nfor cas in range(int(input())) : doit()'
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

```

Measured memory_bytes: 13287