#include <bits/stdc++.h>
int32_t main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    int n, x, r;
    scanf("%d", &n);
    scanf("%d", &r);
    std::vector<int> a;
    for (int i = 1; i <= n; i++) {
      scanf("%d", &x);
      a.push_back(x);
    }
    std::sort(a.rbegin(), a.rend());
    int res = 1, re = r;
    for (int i = 1; i < n; i++) {
      if (a[i] == a[i - 1] || re >= a[i]) continue;
      re += r;
      res++;
    }
    printf("%d\n", res);
  }
  return 0;
}
