#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t;
  cin >> t;
  while (t--) {
    long long n, k;
    cin >> n >> k;
    priority_queue<long long, vector<long long>, greater<long long>> pq;
    long long used = 0;
    long long maxi = LLONG_MIN;
    for (long long i = 0; i < n; i++) {
      long long a;
      cin >> a;
      pq.push(a);
      maxi = max(maxi, a);
    }
    bool flag = false;
    if (maxi > k) {
      flag = true;
    }
    while (!pq.empty() && !flag) {
      long long u = pq.top();
      pq.pop();
      long long v = pq.top();
      pq.pop();
      if (u < v) {
        v = u + v;
        maxi = max(maxi, v);
        pq.push(u);
        pq.push(v);
      } else {
        u = u + v;
        maxi = max(maxi, u);
        pq.push(v);
        pq.push(u);
      }
      if (maxi > k) {
        break;
      }
      used++;
    }
    cout << used << endl;
  }
  return 0;
}
