#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const int N = 100010;
int a[N];
bool cmp(int x, int y) { return x > y; }
int main() {
  ios::sync_with_stdio(false);
  int t;
  cin >> t;
  while (t--) {
    int n, k;
    cin >> n >> k;
    set<int> se;
    int num = 0;
    for (int i = 0, x; i < n; i++) {
      cin >> x;
      if (!se.count(x)) {
        a[num++] = x;
        se.insert(x);
      }
    }
    sort(a, a + num, cmp);
    int j = 0;
    while (a[j] - k * j > 0 && j < num) j++;
    cout << j << endl;
  }
  return 0;
}
