#include <bits/stdc++.h>
using namespace std;
int main() {
  int q;
  scanf("%d", &q);
  while (q--) {
    int n, r;
    scanf("%d %d", &n, &r);
    int first[100005];
    for (int i = 0; i < n; i++) scanf("%d", &first[i]);
    sort(first, first + n);
    vector<int> tmp;
    for (int i = 0; i < n; i++) {
      if (i != 0 && first[i] == first[i - 1]) continue;
      tmp.push_back(first[i]);
    }
    int ans = 0;
    reverse(tmp.begin(), tmp.end());
    for (auto it : tmp) {
      if (it <= r * ans) break;
      ans++;
    }
    printf("%d\n", ans);
  }
}
