#include <bits/stdc++.h>
using namespace std;
int t, n, r, a[100009], R, ans;
int main() {
  cin >> t;
  while (t--) {
    cin >> n >> r;
    R = 0, ans = 0;
    for (int i = 0; i < n; i++) cin >> a[i];
    sort(a, a + n);
    for (int i = n - 1; i >= 0; i--) {
      while (a[i - 1] == a[i] && i > 0) i--;
      if ((a[i] - R) > 0) R += r, ans++;
    }
    cout << ans << endl;
  }
}
