#include <bits/stdc++.h>
using namespace std;
int a[100005];
int main() {
  int q, n, r;
  cin >> q;
  while (q--) {
    cin >> n >> r;
    for (int i = 0; i < n; i++) cin >> a[i];
    sort(a, a + n);
    int ans = 1, pos = n - 1;
    for (int i = n - 2; i >= 0; i--) {
      if (a[i] == a[pos]) continue;
      if (a[i] < a[pos] && a[i] - ans * r > 0) {
        pos = i;
        ans++;
      }
      if (a[i] - ans * r == 0) break;
    }
    cout << ans << endl;
  }
  return 0;
}
