#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio;
  cin.tie(0);
  cout.tie(0);
  int q, n, r;
  cin >> q;
  for (int i = 0; i < q; i++) {
    cin >> n >> r;
    int arr[n];
    int counter = 0;
    for (int j = 0; j < n; j++) {
      cin >> arr[j];
    }
    sort(arr, arr + n);
    for (int j = n - 1; j >= 1; j--) {
      if (arr[j] - (counter * r) > 0 && arr[j] != arr[j - 1]) {
        counter += 1;
      }
    }
    if (arr[0] - (counter * r) > 0) {
      counter += 1;
    }
    cout << counter << endl;
  }
}
