#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t, i, j;
  cin >> t;
  while (t--) {
    long long n, r;
    cin >> n >> r;
    long long a[n];
    for (long long c1 = 0; c1 < n; c1++) cin >> a[c1];
    ;
    sort(a, a + n, greater<long long>());
    long long ans = 0, c = 0, i = 0;
    while (i < n) {
      if (a[i] <= c) break;
      long long temp = a[i];
      if (a[i] > c) {
        ++ans;
        c += r;
      }
      while (i < n && a[i] > c && a[i] == temp) {
        ++i;
      }
    }
    cout << ans << "\n";
  }
  return 0;
}
