#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long n, r, temp;
    cin >> n >> r;
    set<long long> s;
    for (int i = 0; i < n; i++) {
      cin >> temp;
      s.insert(temp);
    }
    vector<long long> grid(s.begin(), s.end());
    bool flag = 0;
    for (int i = 0; i < grid.size(); i++) {
      if (grid[i] > r * (grid.size() - i - 1)) {
        cout << grid.size() - i << endl;
        flag = 1;
        break;
      }
    }
    if (flag == 0) {
      cout << "1" << endl;
    }
  }
}
