#include <bits/stdc++.h>
using namespace std;
inline void read(int& s) {
  s = 0;
  static char c = getchar();
  while (c < '0' || c > '9') c = getchar();
  while (c >= '0' && c <= '9')
    s = (s << 3) + (s << 1) + (c ^ 48), c = getchar();
  return;
}
const int N = 100003;
int Q, n, x, a[N];
int main() {
  read(Q);
  while (Q--) {
    read(n), read(x);
    int i;
    for (i = 1; i <= n; ++i) read(a[i]);
    sort(a + 1, a + 1 + n);
    int ans = 0, now = 0;
    for (i = n; i; --i) {
      if (a[i] - now <= 0) break;
      ++ans;
      now += x;
      while (i && a[i - 1] == a[i]) --i;
    }
    printf("%d\n", ans);
  }
  return 0;
}
