#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n, k;
  cin >> n >> k;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  int moves = 0;
  int current = 0;
  int left = 0;
  for (int i = n - 1; i >= 0; i--) {
    if (current == a[i]) {
      continue;
    }
    if (a[i] - left > 0) {
      moves++;
      current = a[i];
      left += k;
    } else {
      break;
    }
  }
  cout << moves << endl;
}
int main() {
  int t = 1;
  cin >> t;
  for (int i = 0; i < t; i++) solve();
}
