#include <bits/stdc++.h>
using namespace std;
int n, r, a[200005], now, ans, T;
int gets() {
  int v = 0;
  char ch;
  bool f = 0;
  while (!isdigit(ch = getchar()))
    if (ch == '-') f = 1;
  v = ch - 48;
  while (isdigit(ch = getchar())) v = (v << 1) + (v << 3) + ch - 48;
  return f ? -v : v;
}
void test() {
  n = gets(), r = gets();
  ans = 0;
  for (int i = 1; i <= n; i++) a[i] = gets();
  sort(1 + a, 1 + a + n);
  now = n + 1;
  a[n + 1] = a[n] + 1;
  for (int i = n; i >= 1; i--) {
    if (a[i] - r * ans <= 0) break;
    if (a[i] != a[now]) now = i, ans++;
  }
  printf("%d\n", ans);
}
int main() {
  T = gets();
  while (T--) test();
  return 0;
}
