#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long t;
  cin >> t;
  while (t--) {
    long long d, n;
    cin >> n >> d;
    long long a[n];
    for (long long i = 0; i < n; i++) cin >> a[i];
    sort(a, a + n);
    long long steps, left, mini = INT_MAX;
    for (long long i = n - 1; i >= 0; i--) {
      steps = d / a[i];
      left = d - steps * a[i];
      if (left == 0) {
        if (steps < mini) mini = steps;
        break;
      }
      if (a[i] < d)
        steps++;
      else
        steps += 2;
      mini = min(steps, mini);
    }
    cout << mini << endl;
  }
}
