#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, m, k, t, sum = 0, ans = 0, p = 0, q;
  cin >> t;
  while (t--) {
    sum = 0;
    cin >> n >> m;
    long long int a[n];
    for (long long int i = 0; i <= n - 1; i++) cin >> a[i];
    sort(a, a + n);
    for (long long int i = n - 1; i >= 0; i--) {
      if (a[i] - m * sum > 0) {
        if (i != n - 1 && a[i] != a[i + 1]) sum++;
        if (i == n - 1) sum++;
      }
    }
    cout << sum << endl;
  }
  return 0;
}
