#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  long long t;
  cin >> t;
  while (t--) {
    long long n, r;
    cin >> n >> r;
    vector<long long> arr(n);
    for (long long i = 0; i < n; i++) {
      cin >> arr[i];
    }
    sort(arr.begin(), arr.end());
    auto ip = unique(arr.begin(), arr.end());
    arr.resize(distance(arr.begin(), ip));
    long long total = 0, ans = 0;
    for (long long i = arr.size() - 1; i >= 0; i--) {
      if (arr[i] - total > 0) {
        ans++;
        total += r;
      }
    }
    cout << ans << endl;
  }
}
