#include <bits/stdc++.h>
using namespace std;
const int mn = 1e5 + 10;
int q, n, r, t, lo, hi, ans, pos;
int x[mn];
int main() {
  scanf("%d", &q);
  while (q--) {
    scanf("%d%d", &n, &r);
    lo = 1;
    hi = n;
    pos = 1;
    ans = 0;
    for (int i = (1); i <= (n); ++i) scanf("%d", &x[i]);
    sort(x + 1, x + 1 + n);
    while (lo <= hi) {
      --hi;
      while (lo <= hi && x[hi] == x[hi + 1]) --hi;
      ++ans;
      pos += r;
      while (lo <= hi && x[lo] < pos) ++lo;
    }
    printf("%d\n", ans);
  }
}
