#include <bits/stdc++.h>
namespace {
using namespace std;
template <typename T>
istream &operator>>(istream &is, vector<T> &v) {
  for (T &t : v) is >> t;
  return is;
}
template <typename T>
bool space(vector<T>) {
  return false;
}
template <typename T>
bool space(T) {
  return true;
}
bool space(char) { return false; }
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &v) {
  for (const T &t : v) {
    os << t << (space(t) ? " " : "");
  }
  os << "\n";
  return os;
}
long long gcd(long long a, long long b) {
  while (b) {
    long long mod = a % b;
    a = b;
    b = mod;
  }
  return a;
}
template <typename T>
void incr_sort(vector<T> &v) {
  stable_sort(v.begin(), v.end());
}
template <typename T>
void decr_sort(vector<T> &v) {
  stable_sort(v.rbegin(), v.rend());
}
long long sum(const vector<int> &v) {
  long long s = 0;
  for (long long value : v) s += value;
  return s;
}
vector<long long> prefix_sum(const vector<int> &v) {
  vector<long long> res(v.size());
  res[0] = v[0];
  for (int i = 1; i < v.size(); ++i) res[i] = res[i - 1] + v[i];
  return res;
}
}  // namespace
void solve();
int main() {
  cin.tie(nullptr);
  cout.tie(nullptr);
  ios::sync_with_stdio(false);
  long long n, r;
  int t = 1;
  cin >> t;
  for (int i = 0; i < t; ++i) solve();
  return 0;
}
void solve() {
  long long n, r;
  cin >> n >> r;
  vector<long long> x(n);
  cin >> x;
  incr_sort(x);
  auto it = unique(x.begin(), x.end());
  int i = it - x.begin() - 1;
  long long delta = 0;
  while (i >= 0 && x[i] - delta > 0) {
    delta += r;
    --i;
  }
  cout << it - x.begin() - 1 - i << "\n";
}
