#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0), cin.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int n, r;
    cin >> n >> r;
    int arr[n + 1];
    bool mark[100005];
    memset(mark, 0, sizeof mark);
    for (int i = 0; i < (int)n; i++) cin >> arr[i];
    sort(arr, arr + n);
    long long ans = 0;
    long long acum = 0;
    for (int i = n - 1; i >= 0; i--) {
      if (arr[i] > acum && !mark[arr[i]]) {
        mark[arr[i]] = 1;
        acum += r;
        ans++;
      }
      if (arr[i] <= acum) break;
    }
    cout << ans << '\n';
  }
  return 0;
}
