#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  long long t;
  cin >> t;
  while (t--) {
    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.begin(), v.end());
    long long c = 0;
    for (long long i = n - 1; i >= 0;) {
      if (v[i] - c * r <= 0) {
        i--;
        continue;
      }
      long long p = v[i];
      long long j = i;
      while (p == v[j] && j >= 0) {
        j--;
      }
      i = j;
      c++;
    }
    cout << c << endl;
  }
  return 0;
}
