#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t, x, y, n, r;
  cin >> t;
  while (t--) {
    cin >> n >> r;
    set<long long int> second;
    long long int used = 0;
    for (long long int i = 0; i < n; i++) {
      cin >> x;
      second.insert(x);
    }
    vector<long long int> v(second.begin(), second.end());
    reverse(v.begin(), v.end());
    for (long long int i = 1; i < v.size(); i++) {
      if (v[i] - i * r <= 0) {
        cout << i << "\n";
        used = 1;
        break;
      }
    }
    if (!used) {
      cout << v.size() << "\n";
    }
  }
  return 0;
}
