#include <bits/stdc++.h>
using namespace std;
int a[200005];
bool cmp(int x, int y) { return x > y; }
int main() {
  int q, n, r, sum, ans;
  scanf("%d", &q);
  while (q--) {
    sum = 0, ans = 0;
    scanf("%d%d", &n, &r);
    for (int i = 0; i < n; i++) {
      scanf("%d", &a[i]);
    }
    sort(a, a + n, cmp);
    for (int i = 0; i < n; i++) {
      while (a[i] == a[i + 1]) {
        i++;
      }
      sum += r;
      ans++;
      if (a[i + 1] - sum <= 0) break;
    }
    printf("%d\n", ans);
  }
  return 0;
}
