#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, i, t, m, c, mx = 0, T, ans = 0, r, k = 0, q, x, y, l;
  cin >> t;
  while (t--) {
    cin >> n >> r;
    long long int a[n];
    map<long long int, long long int> make_pair;
    long long int b[n + 2], j = 0;
    for (i = 0; i < n; i++) {
      cin >> a[i];
      make_pair[a[i]]++;
      if (make_pair[a[i]] == 1) {
        b[j] = a[i];
        j++;
      }
    }
    ans = 0;
    sort(b, b + j);
    for (i = j - 1; i >= 0; i--) {
      if ((b[i] - ans * r) > 0) {
        ans++;
      }
    }
    cout << ans << endl;
  }
}
