#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t;
  cin >> t;
  while (t--) {
    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);
    long long sum = 1, k = 1;
    for (long long i = n - 2; i >= 0; i--) {
      if (a[i] == a[i + 1]) continue;
      if (a[i] <= r * k) {
        break;
      }
      sum++;
      k++;
    }
    cout << sum << "\n";
  }
}
