#include <bits/stdc++.h>
using namespace std;
int main() {
  int q, n, r, x, d, a[100000];
  cin >> q;
  for (int i = 0; i < q; i++) {
    cin >> n >> r;
    for (int j = 0; j < n; j++) {
      cin >> a[j];
    }
    sort(a, a + n);
    n = unique(a, a + n) - a;
    int f = 0;
    for (int j = n - 1; j >= 0; j--) {
      f += (a[j] - f * r > 0);
    }
    cout << f << endl;
  }
  return 0;
}
