#include <bits/stdc++.h>
using namespace std;
const double PI = atan(1.0) * 4;
const long long int INF = 100000000000000003;
const int32_t LOG = 21;
const long long int BIG = pow(2, 20) + 1;
map<long long int, bool> check;
int32_t main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  long long int q;
  cin >> q;
  for (long long int ii = 0; ii < q; ii++) {
    long long int n, r;
    cin >> n >> r;
    long long int arr[n];
    for (long long int i = 0; i < n; i++) cin >> arr[i];
    sort(arr, arr + n);
    reverse(arr, arr + n);
    long long int toSub = 0;
    long long int ans = 0;
    for (long long int i = 0; i < n; i++) {
      if (check.find(arr[i]) != check.end()) {
        continue;
      }
      if (arr[i] - toSub > 0) {
        toSub += r;
        ans++;
        check[arr[i]] = true;
      } else
        break;
    }
    cout << ans << '\n';
    check.clear();
  }
  return 0;
}
