#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
long long r, n;
long long a[maxn];
int main() {
  int cas;
  cin >> cas;
  while (cas--) {
    scanf("%I64d%I64d", &n, &r);
    for (int i = 0; i < n; i++) {
      scanf("%I64d", &a[i]);
    }
    sort(a, a + n);
    long long l = 0, ans = 0;
    a[n] = 1e5 + 10;
    for (int i = n - 1; i >= 0; i--) {
      if (a[i] - l <= 0) break;
      if (a[i] == a[i + 1]) continue;
      ans++;
      l += r;
    }
    printf("%I64d\n", ans);
  }
}
