#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int n, r, p;
    cin >> n >> r;
    set<int> mon;
    for (int j = 0; j < n; j++) {
      cin >> p;
      mon.insert(p);
    }
    int fire = 0;
    int multi = 0;
    for (auto it = mon.rbegin(); it != mon.rend(); it++) {
      if (*it - multi <= 0)
        continue;
      else {
        fire++;
        multi += r;
      }
    }
    cout << fire << "\n";
  }
}
