#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch > '9' || ch < '0') {
    if (ch == '-') f = -f;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = (x << 1) + (x << 3) + (ch ^ 48);
    ch = getchar();
  }
  return x * f;
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, r;
    n = read(), r = read();
    int a[n];
    for (int i = 0; i < n; i++) a[i] = read();
    sort(a, a + n);
    n = unique(a, a + n) - a;
    int ans = 0;
    for (int i = n - 1; i >= 0; i--) {
      ans += a[i] - ans * r > 0;
    }
    cout << ans << endl;
  }
  return 0;
}
