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)$.
for t in range(int(input())):
 n,c = map(int,input().split())
 E =[]
 dic = {}
 for i in range(n):
  x,y = map(int,input().split())
  E.append([x,y])
  dic[x-y] = []

 

 for i in E:
  dic[i[0]-i[1]].append([i[0],i[1]])

 count = 0
 moves = 0
 for i in dic:
  sub = {}
  for j in dic[i]:
   x,y = j[0],j[1]
   if sub.get(x%c,-1)==-1: 
    sub[x%c] = [[x,y]]
   else:
    sub[x%c].append([x,y])

  count += len(sub)

  for j in sub:
   arr = sorted(sub[j])
   m1 = arr[len(arr)//2][0]
   for k in arr:
    moves += abs(k[0]-m1)//c
 print(count,moves)
for t in range(int(input())):
 n,c = map(int,input().split())
 E =[]
 dic = {}
 for i in range(n):
  x,y = map(int,input().split())
  E.append([x,y])
  dic[x-y] = []

 

 for i in E:
  dic[i[0]-i[1]].append([i[0],i[1]])

 count = 0
 moves = 0
 for i in dic:
  sub = {}
  for j in dic[i]:
   x,y = j[0],j[1]
   if sub.get(x%c,-1)==-1: 
    sub[x%c] = [[x,y]]
   else:
    sub[x%c].append([x,y])

  count += len(sub)

  for j in sub:
   arr = sorted(sub[j])
   m1 = arr[len(arr)//2][0]
   for k in arr:
    moves += abs(k[0]-m1)//c
 print(count,moves)