#include <bits/stdc++.h>
using namespace std;
long long add(long long a, long long b) {
  a %= 1000000007;
  b %= 1000000007;
  long long p = (a + b) % 1000000007;
  return (p + 1000000007) % 1000000007;
}
long long mul(long long a, long long b) {
  a %= 1000000007;
  b %= 1000000007;
  long long p = (a * b) % 1000000007;
  return (p + 1000000007) % 1000000007;
}
int main() {
  long long q;
  cin >> q;
  while (q--) {
    long long i, j, n, r;
    cin >> n >> r;
    vector<long long> v;
    for (i = 1; i <= n; i++) {
      long long x;
      cin >> x;
      v.push_back(x);
    }
    long long ans = 0, sum = 0;
    sort(v.begin(), v.end());
    for (i = n - 1; i >= 0; i--) {
      if ((i != n - 1) && (v[i] == v[i + 1])) continue;
      if (v[i] - sum > 0) {
        sum += r;
        ans++;
      }
    }
    cout << ans << endl;
  }
  return 0;
}
