#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t, n, f, d, i, x, y, z, w, sum, j, u, v, b, c, s, q, r;
  cin >> t;
  while (t > 0) {
    cin >> n >> r;
    long long int a[n];
    for (i = 0; i < n; i++) {
      cin >> a[i];
    }
    sort(a, a + n);
    f = 1;
    x = r;
    for (i = n - 2; i >= 0; i--) {
      if (a[i] != a[i + 1]) {
        if (a[i] - x <= 0) {
          break;
        }
        x = x + r;
        f++;
      }
    }
    cout << f << endl;
    t--;
  }
  return 0;
}
