#include <bits/stdc++.h>
using namespace std;
int arr[100005] = {0};
void init() {
  sort(arr, arr + 100005, greater<int>());
  int i = 0;
  while (arr[i] != 0) {
    arr[i] = 0;
    i++;
  }
}
int main() {
  int _t;
  cin >> _t;
  int n, r, tmp, bias = 0, ans = 0, nowshoot = 0;
  while (_t--) {
    bias = 0, ans = 0;
    nowshoot = 0;
    cin >> n >> r;
    for (int i = 0; i < n; i++) {
      scanf("%d", arr + i);
    }
    sort(arr, arr + n);
    for (int i = n - 1; i >= 0; i--) {
      if (arr[i] == nowshoot) {
        continue;
      }
      if (arr[i] - bias <= 0) {
        break;
      }
      ans++;
      bias += r;
      nowshoot = arr[i];
    }
    printf("%d\n", ans);
  }
  return 0;
}
