#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
int main() {
  int t;
  cin >> t;
  int n, r;
  set<int> a;
  int b;
  for (int k = 0; k < t; ++k) {
    cin >> n >> r;
    a.clear();
    for (int i = 0; i < n; ++i) {
      cin >> b;
      a.insert(b);
    }
    int v = 0;
    auto it = a.end();
    --it;
    while (1) {
      if ((*it) - v * r <= 0) break;
      v++;
      if (it == a.begin()) break;
      --it;
    }
    cout << v << endl;
  }
  return 0;
}
