#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int t, n, m, ans, cnt, i;
  cin >> t;
  while (t--) {
    cin >> n >> m;
    vector<long long int> a(n);
    for (i = 0; i < n; i++) cin >> a[i];
    sort(a.begin(), a.end());
    cnt = 0;
    ans = a[0];
    for (i = 1; i < n; i++) {
      if (a[i] < m) {
        cnt += ((m - a[i]) / ans);
        a[i] = a[i] + (((m - a[i]) / ans) * ans);
      }
    }
    sort(a.begin() + 1, a.end());
    if (a[0] < m) {
      for (i = 1; i < n; i++) {
        if ((m - a[0]) >= a[i]) {
          a[0] += a[i];
          cnt += 1;
        }
      }
    }
    cout << cnt << endl;
  }
  return 0;
}
