#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5;
const long long int inf = 1e18 + 1e17;
void solve() {
  int n, d;
  cin >> n >> d;
  int arr[n];
  for (int i = 0; i < n; i++) cin >> arr[i];
  sort(arr, arr + n);
  int ans = 1e9;
  for (int i = n - 1; i >= 0; i--) {
    if (arr[i] > d)
      ans = 2;
    else if (arr[i] == d)
      ans = 1;
    else if (arr[i] < d)
      ans = min(d % arr[i] == 0 ? d / arr[i] : d / arr[i] + 1, ans);
  }
  cout << ans << '\n';
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
}
