#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long q;
  cin >> q;
  while (q--) {
    long long n, r;
    cin >> n >> r;
    vector<long long> v(n);
    for (long long i = 0; i < n; ++i) cin >> v[i];
    sort(v.rbegin(), v.rend());
    long long shift = 0;
    long long ans = 0;
    for (long long i = 0; i < n; ++i) {
      if (v[i] - shift <= 0) {
        break;
      } else {
        shift += r;
        ans++;
      }
      while (i < n && v[i] == v[i + 1]) i++;
    }
    cout << ans << endl;
  }
  return 0;
}
