#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int x[N];
int solve() {
  int n, r;
  scanf("%d %d", &n, &r);
  for (int i = 0; i < n; ++i) scanf("%d", x + i);
  sort(x, x + n);
  reverse(x, x + n);
  int ans = 1;
  for (int i = 1; i < n; ++i) {
    if (x[i] != x[i - 1]) {
      if (x[i] - ans * 1LL * r <= 0) return ans;
      ++ans;
    }
  }
  return ans;
}
int main() {
  int test;
  scanf("%d", &test);
  while (test--) printf("%d\n", solve());
}
