#include <bits/stdc++.h>
using namespace std;
long long cnt_power(long long n) {
  long long cnt = 0;
  while (n > 0) {
    cnt++;
    n /= 3;
  }
  return cnt;
}
void solve() {
  long long n, r;
  cin >> n >> r;
  long long a[n];
  for (long long i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  n = unique(a, a + n) - a;
  long long ans = 0;
  for (long long i = n - 1; i >= 0; i--) {
    ans += (a[i] - ans * r > 0);
  }
  cout << ans;
  cout << "\n";
}
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long t;
  cin >> t;
  while (t--) {
    solve();
  }
}
