#include <bits/stdc++.h>
using namespace std;
int main() {
  int q, n, r, p;
  cin >> q;
  vector<int> ans(q, 0);
  for (int i = 0; i < q; ++i) {
    p = 0;
    cin >> n >> r;
    vector<int> x(n);
    for (int j = 0; j < n; ++j) cin >> x[j];
    sort(x.begin(), x.end());
    for (int j = n - 1; j > -1 && x[j] > p; ++ans[i]) {
      p += r;
      for (int v = x[j]; j > -1 && x[j] == v; --j) {
      }
    }
  }
  for (int i = 0; i < q; ++i) cout << ans[i] << endl;
  return 0;
}
