Chef has $N$ points (numbered $1$ through $N$) in a 2D Cartesian coordinate system. For each valid $i$, the $i$-th point is $(x_i, y_i)$. He also has a fixed integer $c$ and he may perform operations of the following type: choose a point $(x_i, y_i)$ and move it to $(x_i + c, y_i + c)$ or $(x_i - c, y_i - c)$.
Now, Chef wants to set up one or more checkpoints (points in the same coordinate system) and perform zero or more operations in such a way that after they are performed, each of his (moved) $N$ points is located at one of the checkpoints.
Chef's primary objective is to minimise the number of checkpoints. Among all options with this minimum number of checkpoints, he wants to choose one which minimises the number of operations he needs to perform.
Can you help Chef find the minimum number of required checkpoints and the minimum number of operations he needs to perform to move all $N$ points to these checkpoints?

-----Input-----
- The first line of the input contains a single integer $T$ denoting the number of test cases. The description of $T$ test cases follows.
- The first line of each test case contains two space-separated integers $N$ and $c$.
- $N$ lines follow. For each valid $i$, the $i$-th of these lines contains two space-separated integers $x_i$ and $y_i$.

-----Output-----
For each test case, print a single line containing two integers ― the minimum number of checkpoints and the minimum number of moves.

-----Constraints-----
- $1 \le T \le 5$
- $1 \le N \le 5 \cdot 10^5$
- $|x_i|, |y_i| \le 10^9$ for each valid $i$
- $0 < c \le 10^9$
- the sum of $N$ over all test cases does not exceed $5 \cdot 10^5$

-----Example Input-----
1
3 1
1 1
1 0
3 2

-----Example Output-----
2 2

-----Explanation-----
Example case 1: One optimal solution is to set up checkpoints at coordinates $(1, 1)$ and $(1, 0)$. Since the points $(1, 1)$ and $(1, 0)$ are already located at checkpoints, Chef can just move the point $(3, 2)$ to the checkpoint $(1, 0)$ in two moves: $(3, 2) \rightarrow (2, 1) \rightarrow (1, 0)$.

```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 collections import defaultdict\n\nfor x in range(int(input())):\n n,r=list(map(int,input().split()))\n d=defaultdict(list)\n p=defaultdict(list)\n for i in range(n):\n  a,b=list(map(int,input().split()))\n  if b-a<0:\n   d[a-b].append(a)\n  else:\n   p[b-a].append(a)\n   \n if r>0:\n  k=0\n  s=0\n  for e in d:\n   c=defaultdict(list)\n   for f in d[e]:\n    c[f%r].append(f)\n   for i in c:\n    L=c[i]\n    L.sort()\n    w=len(c[i])\n    h=w//2\n    for t in range(w):\n     s+=abs(L[t]-L[h])//r\n    \n    k+=1\n  for e in p:\n   c=defaultdict(list)\n   for f in p[e]:\n    c[f%r].append(f)\n   for i in c:\n    L=c[i]\n    L.sort()\n    w=len(c[i])\n    h=w//2\n    for t in range(w):\n     s+=abs(L[t]-L[h])//r\n    \n    \n    k+=1\n  print(k,s)\n else:\n  k=0\n  s=0\n  for e in d:\n   \n     \n    \n   k+=len(d[e])\n  for e in p:\n   \n     \n    \n   k+=len(p[e])\n  print(k,s)'
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

```

Measured memory_bytes: 14613