#include <bits/stdc++.h>
using namespace std;
long long n, r, x[100010];
void solve() {
  cin >> n >> r;
  for (long long i = 1; i <= n; i++) cin >> x[i];
  sort(x + 1, x + n + 1);
  long long dir = n, resp = 0, moveu = 0;
  while (dir > 0) {
    resp++;
    moveu += r;
    while (x[dir] == x[dir - 1] and dir > 0) dir--;
    if (x[dir - 1] - moveu <= 0) {
      cout << resp << "\n";
      return;
    } else
      dir--;
  }
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long t;
  cin >> t;
  for (long long i = 1; i <= t; i++) solve();
}
