#include <bits/stdc++.h>
using namespace std;
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long t;
  cin >> t;
  while (t--) {
    long long N, R;
    cin >> N >> R;
    priority_queue<long long> Q;
    long long sum = 0;
    for (long long i = 0; i < N; i++) {
      long long a;
      cin >> a;
      Q.push(a);
    }
    long long ans = 0;
    bool F[100010] = {false};
    while (!Q.empty()) {
      long long a = Q.top();
      Q.pop();
      if (F[a]) continue;
      F[a] = 1;
      if (a - sum <= 0)
        break;
      else {
        sum += R;
        ans++;
      }
    }
    cout << ans << endl;
  }
  return 0;
}
