#include <bits/stdc++.h>
using namespace std;
long long N, a, b, T, R, r, sol, A[100005], mark[100005], pos;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> T;
  while (T--) {
    cin >> N >> R;
    for (int i = 1; i <= N; i++) cin >> A[i];
    sort(A + 1, A + 1 + N);
    r = sol = 0;
    for (int i = N; i >= 1; i--)
      if (!mark[A[i]]) {
        pos = A[i];
        pos -= r;
        if (pos <= 0) break;
        sol++, r += R;
        mark[A[i]] = 1;
      }
    for (int i = 1; i <= N; i++) mark[A[i]] = 0;
    cout << sol << "\n";
  }
}
