#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  int t;
  cin >> t;
  while (t--) {
    long long n, x;
    cin >> n >> x;
    long long a[n], c = 0;
    for (int i = 0; i < n; i++) {
      cin >> a[i];
      if (a[i] == x) c++;
    }
    if (c > 0)
      cout << "1" << endl;
    else {
      sort(a, a + n);
      if (x <= (2 * (a[n - 1])))
        cout << "2" << endl;
      else {
        if (x % a[n - 1] == 0)
          cout << x / a[n - 1] << endl;
        else {
          long long p, q;
          p = x / a[n - 1];
          q = p * a[n - 1];
          p += 1;
          for (int i = 0; i < n - 1; i++) {
            if (x % a[i] == 0) {
              p = min(p, x / a[i]);
            }
          }
          cout << p << endl;
        }
      }
    }
  }
  return 0;
}
