#include <bits/stdc++.h>
using namespace std;
template <class Ch, class Tr, class Container>
basic_ostream<Ch, Tr>& operator<<(basic_ostream<Ch, Tr>& os,
                                  Container const& x) {
  os << "{ ";
  for (auto& y : x) os << y << " ";
  return os << "}";
}
template <class X, class Y>
ostream& operator<<(ostream& os, pair<X, Y> const& p) {
  return os << "[ " << p.first << ", " << p.second << "]";
}
int M[100005];
int main() {
  int q;
  cin >> q;
  while (q--) {
    int n, r;
    cin >> n >> r;
    for (int i = 0; i < (n); i++) cin >> M[i];
    sort(M, M + n, greater<int>());
    int cant = 1, rs = r, i = 0, j, pos = 0;
    while (i < n) {
      j = i;
      while (j < n && M[i] == M[j]) j++;
      M[pos++] = M[i];
      i = j;
    }
    for (int i = (1); i < (pos); i++) {
      if (M[i] > rs) {
        rs += r;
        cant++;
      } else
        break;
    }
    cout << cant << endl;
  }
}
