#include <bits/stdc++.h>
using namespace std;
bool is[100001];
int main() {
  int q;
  scanf("%d", &q);
  while (q--) {
    int n, r;
    scanf("%d%d", &n, &r);
    memset(is, 0, sizeof(is));
    int arr[n + 10];
    int ind = 0;
    for (int i = 0; i < n; i++) {
      int num;
      scanf("%d", &num);
      if (!is[num]) {
        arr[ind] = num;
        is[num] = 1;
        ind++;
      }
    }
    sort(arr, arr + ind);
    long long val = 0;
    int time = 0;
    for (int i = ind - 1; i >= 0; i--) {
      if (arr[i] - val > 0) {
        val += r;
        time++;
      }
    }
    printf("%d\n", time);
  }
}
