#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, T;
  cin >> T;
  for (t = 0; t < T; t++) {
    int n, m, ans = 0, r = 0;
    cin >> n >> m;
    vector<int> v(n);
    for (int i = 0; i < n; i++) cin >> v[i];
    sort(v.begin(), v.end());
    for (int i = n - 1; i >= 0; i--) {
      if (v[i] - (ans * m) <= 0) {
        break;
      }
      if (r != v[i]) {
        ans++;
        r = v[i];
      }
    }
    cout << ans << endl;
  }
}
