#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int t, n, r, a[N];
void fn() {
  cin >> n >> r;
  int ans = 0, x = 0;
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  for (int i = n - 1; i >= 0; i--) {
    while (a[i] == a[i - 1] && i) i--;
    if (a[i] > x) {
      ans++;
      x = r * ans;
    } else
      break;
  }
  cout << ans << endl;
  return;
}
int main() {
  cin >> t;
  while (t--) fn();
  return 0;
}
