#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t, n, r;
  cin >> t;
  while (t--) {
    cin >> n >> r;
    vector<long long> v(n);
    set<long long> s;
    for (int i = 0; i < n; i++) {
      cin >> v[i];
      s.insert(v[i]);
    }
    vector<long long> a;
    for (auto i : s) {
      a.push_back(i);
    }
    int co = 0;
    long long cur = 0;
    for (int i = a.size() - 1; i >= 0; i--) {
      if (a[i] - cur > 0) {
        a[i] = 0;
        co++;
        cur += r;
      } else
        break;
    }
    cout << co << endl;
  }
  return 0;
}
