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_zigzag(h):\n if (len(h) <= 1):\n  return True\n sign = h[1] - h[0]\n if (len(h) == 2 and sign == 0):\n  return False\n for i in range(2, len(h)):\n  diff = h[i] - h[i - 1]\n  if (diff * sign >= 0):\n   return False\n  sign = diff \n return True\n\ndef is_possible(h, r):\n for i in range(1, len(h)):\n  diff = h[i] - h[i - 1]\n  if (diff < 0 and r[i] > r[i - 1]):\n   return True\n  elif (diff > 0 and r[i] < r[i - 1]):\n   return True\n  elif (diff == 0 and r[i] != r[i - 1]):\n   return True\n return False\n\ndef add_day(h, r):\n for i in range(len(h)):\n  h[i] += r[i]\n\nINF = float('inf')\ndef find_intervals(heights, rates):\n intervals = []\n f = is_zigzag(heights)\n if (f):\n  interval = [0, 'Inf']\n  intervals.append(interval)\n day = 0\n while (is_possible(heights, rates)):\n  day += 1\n  add_day(heights, rates)\n  if (is_zigzag(heights)):\n   if (f == 1):\n    continue\n   else:\n    intervals.append([day, 'Inf'])\n    f = 1\n  else:\n   if (f == 1):\n    intervals[-1][-1] = day - 1\n    f = 0\n\n return intervals\n\n\nt = int(input())\nfor i in range(t):\n n = int(input())\n heights = []\n rates = []\n for k in range(n):\n  h, m = list(map(int, input().split()))\n  heights.append(h)\n  rates.append(m)\n intervals = find_intervals(heights, rates)\n print(len(intervals))\n for interval in intervals:\n  print('{} {}'.format(interval[0], interval[1]))\n"
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

```

Measured memory_bytes: 13909