#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n, r, x[200123], shot, locshot, pushed;
  cin >> n >> r;
  for (int i = 0; i < n; i++) cin >> x[i];
  sort(x, x + n);
  shot = 1;
  locshot = x[n - 1];
  pushed = r;
  for (int i = n - 1; i >= 0; i--) {
    if (x[i] != locshot && x[i] - pushed > 0) {
      shot++;
      locshot = x[i];
      pushed += r;
    }
  }
  cout << shot << endl;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  if (fopen("input.in", "r")) {
    freopen("input.in", "r", stdin);
    freopen("output.out", "w", stdout);
  }
  int q;
  cin >> q;
  while (q--) solve();
  return 0;
}
