#include <bits/stdc++.h>
using namespace std;
int main() {
  int q;
  cin >> q;
  vector<int> res;
  for (int i = 0; i < q; i++) {
    vector<int> x;
    int n, r;
    cin >> n >> r;
    for (int j = 0; j < n; j++) {
      int y;
      cin >> y;
      x.push_back(y);
    }
    sort(x.begin(), x.end());
    vector<int>::iterator it = x.begin();
    vector<int>::iterator it1 = x.begin();
    it1++;
    while (it1 != x.end()) {
      if (*it1 == *it) {
        x.erase(it1);
        it1 = it;
        it1++;
      } else {
        it++;
        it1++;
      }
    }
    int k = 0;
    int n1 = x.size();
    while (x[n1 - 1 - k] > k * r) {
      k++;
      if (k == n1) {
        break;
      }
    }
    res.push_back(k);
  }
  for (int i = 0; i < q; i++) {
    cout << res[i] << endl;
  }
  return 0;
}
