Numbers $1, 2, 3, \dots n$ (each integer from $1$ to $n$ once) are written on a board. In one operation you can erase any two numbers $a$ and $b$ from the board and write one integer $\frac{a + b}{2}$ rounded up instead.

You should perform the given operation $n - 1$ times and make the resulting number that will be left on the board as small as possible. 

For example, if $n = 4$, the following course of action is optimal:  choose $a = 4$ and $b = 2$, so the new number is $3$, and the whiteboard contains $[1, 3, 3]$;  choose $a = 3$ and $b = 3$, so the new number is $3$, and the whiteboard contains $[1, 3]$;  choose $a = 1$ and $b = 3$, so the new number is $2$, and the whiteboard contains $[2]$. 

It's easy to see that after $n - 1$ operations, there will be left only one number. Your goal is to minimize it.


-----Input-----

The first line contains one integer $t$ ($1 \le t \le 1000$) — the number of test cases.

The only line of each test case contains one integer $n$ ($2 \le n \le 2 \cdot 10^5$) — the number of integers written on the board initially.

It's guaranteed that the total sum of $n$ over test cases doesn't exceed $2 \cdot 10^5$.


-----Output-----

For each test case, in the first line, print the minimum possible number left on the board after $n - 1$ operations. Each of the next $n - 1$ lines should contain two integers — numbers $a$ and $b$ chosen and erased in each operation.


-----Example-----
Input
1
4

Output
2
2 4
3 3
3 1

```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 sys\nimport random\n# import numpy as np\nimport math\nimport copy\nfrom heapq import heappush, heappop, heapify\nfrom functools import cmp_to_key\nfrom bisect import bisect_left, bisect_right\nfrom collections import defaultdict, deque, Counter\n# sys.setrecursionlimit(1000000)\n# input aliases\ninput = sys.stdin.readline\ngetS = lambda: input().strip()\ngetN = lambda: int(input())\ngetList = lambda: list(map(int, input().split()))\ngetZList = lambda: [int(x) - 1 for x in input().split()]\n\nINF = float("inf")\n\nMOD = 10 ** 9 + 7\ndivide = lambda x: pow(x, MOD-2, MOD)\n\ndef judge(at, ax, ay, bt, bx, by):\n    if abs(at - bt) >= abs(ax - bx) + abs(ay - by):\n        return True\n    else:\n        return False\n\n\ndef solve():\n    n = getN()\n    if n == 2:\n        print(2)\n        print(1, 2)\n        return\n\n    print(2)\n    print(n-2, n)\n    print(n-1, n-1)\n    for i in range(n-3):\n        print(n-1-i, n-3-i)\n    return\n\ndef main():\n    n = getN()\n    for _ in range(n):\n        solve()\n\n    return\ndef __starting_point():\n    main()\n    # solve()\n\n__starting_point()'
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

```

Measured memory_bytes: 178127