#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int main(void) {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int q;
  cin >> q;
  while (q--) {
    int n, r;
    cin >> n >> r;
    vector<long long> v;
    for (int i = 0; i < n; i++) {
      long long x;
      cin >> x;
      v.emplace_back(x);
    }
    sort(v.begin(), v.end());
    v.resize(unique(v.begin(), v.end()) - v.begin());
    long long cur = 0, ans = 0;
    while (v.size() > 0 and v.back() + cur > 0) {
      cur -= r;
      v.pop_back();
      ans++;
    }
    cout << ans << endl;
  }
  return 0;
}
