#include <bits/stdc++.h>
using namespace std;
int a[100005];
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    int n, r;
    scanf("%d%d", &n, &r);
    for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
    sort(a + 1, a + 1 + n);
    long long now = 0;
    int pre = -1;
    int ans = 0;
    for (int i = n; i >= 1; --i) {
      if (a[i] == pre || a[i] + now <= 0) continue;
      pre = a[i];
      now -= r;
      ans++;
    }
    printf("%d\n", ans);
  }
}
