#include <bits/stdc++.h>
using namespace std;
int main() {
  int tc, n, r;
  cin >> tc;
  while (tc--) {
    cin >> n >> r;
    int ara[n];
    for (int i = 0; i < n; i++) cin >> ara[i];
    sort(ara, ara + n);
    n = unique(ara, ara + n) - ara;
    int ans = 0;
    for (int i = n - 1; i >= 0; i--) {
      ans += (ans * r < ara[i]) ? 1 : 0;
    }
    cout << ans << endl;
  }
}
