#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, n, r;
  cin >> t;
  while (t--) {
    cin >> n >> r;
    vector<int> vec(n);
    for (int i = 0; i < n; i++) cin >> vec[i];
    sort(vec.begin(), vec.end());
    vec.erase(unique(vec.begin(), vec.end()), vec.end());
    n = vec.size();
    if (n == 1)
      cout << "1" << endl;
    else {
      int flag = 1;
      for (int k = 1; k < n; k++) {
        if (vec[n - k - 1] <= k * r) {
          cout << k << endl;
          flag = 0;
          break;
        }
      }
      if (flag) cout << n << endl;
    }
  }
  return 0;
}
