#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
int a[maxn];
int main() {
  int T;
  int n, r;
  cin >> T;
  while (T--) {
    scanf("%d%d", &n, &r);
    for (int i = 0; i < n; i++) scanf("%d", &a[i]);
    sort(a, a + n);
    int cnt = unique(a, a + n) - a;
    int ans = 0;
    for (int i = cnt - 1; i >= 0; i--) {
      if (a[i] - (cnt - 1 - i) * r <= 0) break;
      ans++;
    }
    printf("%d\n", ans);
  }
}
