#include <bits/stdc++.h>
using namespace std;
const int MAXn = 3e5 + 5;
const long long INF = 1e18;
const long long mod = 1e9 + 7;
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long n, r;
    cin >> n >> r;
    set<long long> s;
    while (n--) {
      long long x;
      cin >> x;
      s.insert(x);
    }
    vector<long long> v;
    for (auto x : s) v.push_back(x);
    int count = 0;
    long long temp = 0;
    while (v.size() > 0) {
      if (v.back() <= 0) break;
      v.pop_back();
      temp += r;
      count++;
      if (v.size() <= 0) break;
      v.back() -= temp;
    }
    cout << count << endl;
  }
}
