#include <bits/stdc++.h>
using namespace std;
int a[1000000];
int tp[1000000];
int main() {
  int T;
  scanf("%d", &T);
  while (T--) {
    int n, r;
    scanf("%d %d", &n, &r);
    int maxx = 0;
    for (int i = 1; i <= n; i++) {
      scanf("%d", &a[i]);
    }
    sort(a + 1, a + 1 + n);
    int ans = 0;
    int k = 0;
    for (int i = n; i >= 1; i--) {
      if (i > 1 && a[i] == a[i - 1]) continue;
      if (a[i] - r * ans <= 0) break;
      ans++;
    }
    printf("%d\n", ans);
  }
}
