#include <bits/stdc++.h>
using namespace std;
const int N = 1000005;
int T, n, a[N], r, ans;
inline void fr(int &num) {
  num = 0;
  char c = getchar();
  int p = 1;
  while (c < '0' || c > '9') c == '-' ? p = -1, c = getchar() : c = getchar();
  while (c >= '0' && c <= '9') num = num * 10 + c - '0', c = getchar();
  num *= p;
}
int main() {
  fr(T);
  while (T--) {
    fr(n), fr(r), ans = 0;
    for (register int i = 1; i <= n; ++i) fr(a[i]);
    sort(a + 1, a + 1 + n);
    n = unique(a + 1, a + 1 + n) - a - 1;
    register int nowd = 0, j = 1;
    for (register int i = n; i >= 1; --i) {
      ++ans, nowd += r;
      while (a[j] <= nowd && j <= n) ++j;
      if (j >= i) break;
    }
    printf("%d\n", ans);
  }
  return 0;
}
