#include <bits/stdc++.h>
using namespace std;
long long min(long long a, long long b) {
  if (a < b)
    return a;
  else
    return b;
}
long long max(long long a, long long b) {
  if (a > b)
    return a;
  else
    return b;
}
int main() {
  int time;
  cin >> time;
  for (int t = 0; t < time; t++) {
    long long n, x;
    cin >> n >> x;
    vector<int> a(n);
    long long maxi = 0;
    long long answ = 1000000999999;
    for (int i = 0; i < n; i++) {
      cin >> a[i];
      if (x % a[i] == 0) {
        answ = min(answ, x / a[i]);
      }
      maxi = max(a[i], maxi);
    }
    if (maxi > x) {
      cout << min(answ, 2) << "\n";
      continue;
    }
    long long count = x / maxi;
    x -= maxi * (count);
    if (x == 0) {
      cout << min(count, answ) << "\n";
    } else {
      cout << min(count + 1, answ) << "\n";
    }
  }
}
