// I want to AC

#include <vector>
#include<stdio.h>
#include<string.h>
#include <cstring>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <set>
#include<cstring>
#include<queue>
#include<assert.h>
#define ll long long
#define MODD 1000000007
#define  pii  pair<int,int>
#include<stdio.h>
#include<string.h>
#include<bits/stdc++.h>
//#define  ll long long
using namespace std;
const int maxn = 1e6+7;
const int N = 1e5+10;

#define FOR(i, x, y) for (ll i = (x), _##i = (y); i < _##i; ++i)

ll mod = 1e9+7;
//const int maxn = 100010;
//ll f[maxn];
//ll inv[maxn]; // 阶乘的逆元
//void CalFact()
//{
//    f[0] = 1;
//    for (int i = 1; i < maxn; i++) f[i] = (f[i - 1] * i) % p;
//    inv[maxn - 1] = Pow(f[maxn - 1], p - 2, p);
//    for (int i = maxn - 2; ~i; i--) inv[i] = inv[i + 1] * (i + 1) % p;
//}
//ll C(int n, int m) { return f[n] * inv[m] % p * inv[n - m] % p; }

//int h[N], e[N] , ne[N], idx ;
//int depth[N], fa[N][16];
//int qu[N];
//vector <int > g[N];
//void add(int a , int b ){
//    h[idx] = b;
//    ne[idx] = h[a];
//    h[a] =idx++;
//}
//void dfs(int root){
//    for(int i=0;i<g[root].size();i++){
//            int v = g[root][i];
//            if(v== fa[root][0])continue ;
//            fa[v][0] = root ;
//            depth[v] = depth[root]+1 ;
//            dfs(v);
//    }
//
//
//}
//void bfs(int root)
//{
//    memset(depth, 0x3f, sizeof depth);
//    depth[0] = 0, depth[root] = 1;
//    int hh = 0, tt = 0;
//    qu[0] = root;
//    while (hh <= tt)
//    {
//        int t = qu[hh ++ ];
//        for (int i = h[t]; ~i; i = ne[i])
//        {
//            int j = e[i];
//            if (depth[j] > depth[t] + 1)
//            {
//                depth[j] = depth[t] + 1;
//                qu[ ++ tt] = j;
//                fa[j][0] = t;
//                for (int k = 1; k <= 16; k ++ )
//                    fa[j][k] = fa[fa[j][k - 1]][k - 1];
//            }
//        }
//    }
//}
//
//int lca(int a, int b)
//{
//    if (depth[a] < depth[b]) swap(a, b);
//    for (int k = 15; k >= 0; k -- )
//        if (depth[fa[a][k]] >= depth[b])
//            a = fa[a][k];
//    if (a == b) return a;
//    for (int k = 16; k >= 0; k -- )
//        if (fa[a][k] != fa[b][k])
//        {
//            a = fa[a][k];
//            b = fa[b][k];
//        }
//    return fa[a][0];
//}
//
//int dis ( int x, int y )
//{
//    return depth[x] + depth[y] - depth[lca(x,y)]* 2;
//
//}
//bool check ( int x , int y){
//    return y>=x  &&x%2 == y%2 ;
//}
int t;
int ar[maxn];
int main() {
    cin >>t;
    while(t--){
        int n,x ;
        cin >>n>>x;
        for(int i=0;i<n;i++)cin>>ar[i];
        sort(ar, ar+n);
//        cout<<ar[0]<<endl;
int sum = 0x7f7f7f;int pos =0 ;
        for(int i=n-1;i>=0;i--){
            if(ar[i]<= x &&sum >x/ar[i])
               {
                    sum = x/ar[i], pos = i;
               }
            else if(ar[i] >x ) sum = min(sum , 1), pos = i;
        }
       // cout<<pos<<endl;
        if ((x >=ar[pos ] && x %ar[pos]==0))cout<<sum<<endl;
        else cout<<sum+1<<endl;
//        cout<<n<<endl;
    }
	return 0;

}


// I want to AC

#include <vector>
#include<stdio.h>
#include<string.h>
#include <cstring>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <set>
#include<cstring>
#include<queue>
#include<assert.h>
#define ll long long
#define MODD 1000000007
#define  pii  pair<int,int>
#include<stdio.h>
#include<string.h>
#include<bits/stdc++.h>
//#define  ll long long
using namespace std;
const int maxn = 1e6+7;
const int N = 1e5+10;

#define FOR(i, x, y) for (ll i = (x), _##i = (y); i < _##i; ++i)

ll mod = 1e9+7;
//const int maxn = 100010;
//ll f[maxn];
//ll inv[maxn]; // 阶乘的逆元
//void CalFact()
//{
//    f[0] = 1;
//    for (int i = 1; i < maxn; i++) f[i] = (f[i - 1] * i) % p;
//    inv[maxn - 1] = Pow(f[maxn - 1], p - 2, p);
//    for (int i = maxn - 2; ~i; i--) inv[i] = inv[i + 1] * (i + 1) % p;
//}
//ll C(int n, int m) { return f[n] * inv[m] % p * inv[n - m] % p; }

//int h[N], e[N] , ne[N], idx ;
//int depth[N], fa[N][16];
//int qu[N];
//vector <int > g[N];
//void add(int a , int b ){
//    h[idx] = b;
//    ne[idx] = h[a];
//    h[a] =idx++;
//}
//void dfs(int root){
//    for(int i=0;i<g[root].size();i++){
//            int v = g[root][i];
//            if(v== fa[root][0])continue ;
//            fa[v][0] = root ;
//            depth[v] = depth[root]+1 ;
//            dfs(v);
//    }
//
//
//}
//void bfs(int root)
//{
//    memset(depth, 0x3f, sizeof depth);
//    depth[0] = 0, depth[root] = 1;
//    int hh = 0, tt = 0;
//    qu[0] = root;
//    while (hh <= tt)
//    {
//        int t = qu[hh ++ ];
//        for (int i = h[t]; ~i; i = ne[i])
//        {
//            int j = e[i];
//            if (depth[j] > depth[t] + 1)
//            {
//                depth[j] = depth[t] + 1;
//                qu[ ++ tt] = j;
//                fa[j][0] = t;
//                for (int k = 1; k <= 16; k ++ )
//                    fa[j][k] = fa[fa[j][k - 1]][k - 1];
//            }
//        }
//    }
//}
//
//int lca(int a, int b)
//{
//    if (depth[a] < depth[b]) swap(a, b);
//    for (int k = 15; k >= 0; k -- )
//        if (depth[fa[a][k]] >= depth[b])
//            a = fa[a][k];
//    if (a == b) return a;
//    for (int k = 16; k >= 0; k -- )
//        if (fa[a][k] != fa[b][k])
//        {
//            a = fa[a][k];
//            b = fa[b][k];
//        }
//    return fa[a][0];
//}
//
//int dis ( int x, int y )
//{
//    return depth[x] + depth[y] - depth[lca(x,y)]* 2;
//
//}
//bool check ( int x , int y){
//    return y>=x  &&x%2 == y%2 ;
//}
int t;
int ar[maxn];
int main() {
    cin >>t;
    while(t--){
        int n,x ;
        cin >>n>>x;
        for(int i=0;i<n;i++)cin>>ar[i];
//        int avg  = x/n;
//        for(int i=0;i<n;i++){}
        cout<<n<<endl;
    }
	return 0;

}


// I want to AC

#include <vector>
#include<stdio.h>
#include<string.h>
#include <cstring>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <set>
#include<cstring>
#include<queue>
#include<assert.h>
#define ll long long
#define MODD 1000000007
#define  pii  pair<int,int>
#include<stdio.h>
#include<string.h>
#include<bits/stdc++.h>
//#define  ll long long
using namespace std;
const int maxn = 1e6+7;
const int N = 1e5+10;

#define FOR(i, x, y) for (ll i = (x), _##i = (y); i < _##i; ++i)

ll mod = 1e9+7;
//const int maxn = 100010;
//ll f[maxn];
//ll inv[maxn]; // 阶乘的逆元
//void CalFact()
//{
//    f[0] = 1;
//    for (int i = 1; i < maxn; i++) f[i] = (f[i - 1] * i) % p;
//    inv[maxn - 1] = Pow(f[maxn - 1], p - 2, p);
//    for (int i = maxn - 2; ~i; i--) inv[i] = inv[i + 1] * (i + 1) % p;
//}
//ll C(int n, int m) { return f[n] * inv[m] % p * inv[n - m] % p; }

//int h[N], e[N] , ne[N], idx ;
//int depth[N], fa[N][16];
//int qu[N];
//vector <int > g[N];
//void add(int a , int b ){
//    h[idx] = b;
//    ne[idx] = h[a];
//    h[a] =idx++;
//}
//void dfs(int root){
//    for(int i=0;i<g[root].size();i++){
//            int v = g[root][i];
//            if(v== fa[root][0])continue ;
//            fa[v][0] = root ;
//            depth[v] = depth[root]+1 ;
//            dfs(v);
//    }
//
//
//}
//void bfs(int root)
//{
//    memset(depth, 0x3f, sizeof depth);
//    depth[0] = 0, depth[root] = 1;
//    int hh = 0, tt = 0;
//    qu[0] = root;
//    while (hh <= tt)
//    {
//        int t = qu[hh ++ ];
//        for (int i = h[t]; ~i; i = ne[i])
//        {
//            int j = e[i];
//            if (depth[j] > depth[t] + 1)
//            {
//                depth[j] = depth[t] + 1;
//                qu[ ++ tt] = j;
//                fa[j][0] = t;
//                for (int k = 1; k <= 16; k ++ )
//                    fa[j][k] = fa[fa[j][k - 1]][k - 1];
//            }
//        }
//    }
//}
//
//int lca(int a, int b)
//{
//    if (depth[a] < depth[b]) swap(a, b);
//    for (int k = 15; k >= 0; k -- )
//        if (depth[fa[a][k]] >= depth[b])
//            a = fa[a][k];
//    if (a == b) return a;
//    for (int k = 16; k >= 0; k -- )
//        if (fa[a][k] != fa[b][k])
//        {
//            a = fa[a][k];
//            b = fa[b][k];
//        }
//    return fa[a][0];
//}
//
//int dis ( int x, int y )
//{
//    return depth[x] + depth[y] - depth[lca(x,y)]* 2;
//
//}
//bool check ( int x , int y){
//    return y>=x  &&x%2 == y%2 ;
//}
int t;
ll ar[maxn];
int main() {
    cin >>t;
    while(t--){
        ll n,x ;
        ll sum = 1e9+10;
        cin >>n>>x;
        for(int i=0;i<n;i++)cin>>ar[i];
        sort(ar, ar+n);
//        cout<<ar[0]<<endl;
int pos =n ;
        for(int i=n-1;i>=0;i--){
            if(ar[i]< x ){
                if(sum > x/ar[i])sum = x/ar[i] , pos = i;
                else if( sum == x / ar[i] && x %ar[i]==0)pos = i;
            }
            else sum = 1,pos =i ;
        }
        if (pos !=n&&( x %ar[pos]==0))cout<<sum<<endl;
        else cout<<sum+1<<endl;
//        cout<<n<<endl;
    }
	return 0;

}


// I want to AC

#include <vector>
#include<stdio.h>
#include<string.h>
#include <cstring>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <set>
#include<cstring>
#include<queue>
#include<assert.h>
#define ll long long
#define MODD 1000000007
#define  pii  pair<int,int>
#include<stdio.h>
#include<string.h>
#include<bits/stdc++.h>
//#define  ll long long
using namespace std;
const int maxn = 1e6+7;
const int N = 1e5+10;

#define FOR(i, x, y) for (ll i = (x), _##i = (y); i < _##i; ++i)

ll mod = 1e9+7;
//const int maxn = 100010;
//ll f[maxn];
//ll inv[maxn]; // 阶乘的逆元
//void CalFact()
//{
//    f[0] = 1;
//    for (int i = 1; i < maxn; i++) f[i] = (f[i - 1] * i) % p;
//    inv[maxn - 1] = Pow(f[maxn - 1], p - 2, p);
//    for (int i = maxn - 2; ~i; i--) inv[i] = inv[i + 1] * (i + 1) % p;
//}
//ll C(int n, int m) { return f[n] * inv[m] % p * inv[n - m] % p; }

//int h[N], e[N] , ne[N], idx ;
//int depth[N], fa[N][16];
//int qu[N];
//vector <int > g[N];
//void add(int a , int b ){
//    h[idx] = b;
//    ne[idx] = h[a];
//    h[a] =idx++;
//}
//void dfs(int root){
//    for(int i=0;i<g[root].size();i++){
//            int v = g[root][i];
//            if(v== fa[root][0])continue ;
//            fa[v][0] = root ;
//            depth[v] = depth[root]+1 ;
//            dfs(v);
//    }
//
//
//}
//void bfs(int root)
//{
//    memset(depth, 0x3f, sizeof depth);
//    depth[0] = 0, depth[root] = 1;
//    int hh = 0, tt = 0;
//    qu[0] = root;
//    while (hh <= tt)
//    {
//        int t = qu[hh ++ ];
//        for (int i = h[t]; ~i; i = ne[i])
//        {
//            int j = e[i];
//            if (depth[j] > depth[t] + 1)
//            {
//                depth[j] = depth[t] + 1;
//                qu[ ++ tt] = j;
//                fa[j][0] = t;
//                for (int k = 1; k <= 16; k ++ )
//                    fa[j][k] = fa[fa[j][k - 1]][k - 1];
//            }
//        }
//    }
//}
//
//int lca(int a, int b)
//{
//    if (depth[a] < depth[b]) swap(a, b);
//    for (int k = 15; k >= 0; k -- )
//        if (depth[fa[a][k]] >= depth[b])
//            a = fa[a][k];
//    if (a == b) return a;
//    for (int k = 16; k >= 0; k -- )
//        if (fa[a][k] != fa[b][k])
//        {
//            a = fa[a][k];
//            b = fa[b][k];
//        }
//    return fa[a][0];
//}
//
//int dis ( int x, int y )
//{
//    return depth[x] + depth[y] - depth[lca(x,y)]* 2;
//
//}
//bool check ( int x , int y){
//    return y>=x  &&x%2 == y%2 ;
//}
int t;
int ar[maxn];
int main() {
    cin >>t;
    while(t--){
        int n,x ;
        cin >>n>>x;
        for(int i=0;i<n;i++)cin>>ar[i];
        sort(ar, ar+n);
//        cout<<ar[0]<<endl;
int sum = 0x7f7f7f;int pos =0 ;
        for(int i=n-1;i>=0;i--){
            if(ar[i]< x ){
                if(sum > x / ar[i])sum = x/ ar[i] , pos = i;
                else if( sum == x / ar[i] && x %ar[i]==0)pos = i;
            }
            else sum = 1,pos =i ;
        }
        if (( x %ar[pos]==0))cout<<sum<<endl;
        else cout<<sum+1<<endl;
//        cout<<n<<endl;
    }
	return 0;

}


#include <iostream>
#include <cstdio>
#include <fstream>
#include <algorithm>
#include <cmath>
#include <deque>
#include <vector>
#include <queue>
#include <string>
#include <cstring>
#include <map>
#include <stack>
#include <set>
#include<iomanip>
#define SIS std::ios::sync_with_stdio(false)
#define ll long long
#define INF 0x3f3f3f3f
const int mod = 1e9 + 7;
const double esp = 1e-5;
const double PI = 3.141592653589793238462643383279;
using namespace std;
const int N = 1e6 + 5;
const int maxn = 1 << 20;
/**************************************/
/*
int a[N];
int n, d;
void solve() {
        cin >> n >> d;
		for (int i = 1; i <= n; i++)
		{
			cin >> a[i];
		}
}
int main() {
	int T;
	cin >> T;
	while (T--)
	{
		solve();
		sort(a + 1, a + 1 + n);
		int cnt = 0, flag = INF;
		//int sign = d % a[1];
		for (int i = n; i >= 1; i--)
		{
			cnt = 0;
			if (a[i] <= d)
			{
				//cout<<a[i]<<endl;
				if (d % a[i] == 0)
				{
					cnt += d / a[i];
				}
				else
				{
					cnt += (d / a[i]) + 1;
				}
				flag = min(cnt, flag);
			}
			else
			{
				d = a[i] - d;
			}
		}
		cout << flag << endl;
	}
	return 0;
}*/
int a[N];
int main() {
	int t;
	cin >> t;
	while (t--) {
		int n, d;
		cin >> n >> d;
		for (int i = 1; i <= n; i++)
			cin >> a[i];
		sort(a + 1, a + 1 + n);
		int ans = 0;
		if (d % a[n] == 0)
			ans = d / a[n];
		else {
		      while (d > (2*a[n])) {
			       d = d - a[n];
			       ans++;
		       }
			  ans += 2;
		}
		cout << ans << endl;
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int a[1000005];
int main(){
	int t;
	cin>>t;
	while(t--){
		int n,k;
		int sign=0;
		int ans;
		cin>>n>>k;
		for(int i=1;i<=n;i++){
			cin>>a[i];
			if(k==a[i])
			sign=1;
		}
		sort(a+1,a+1+n);
		if(sign==1){
			cout<<1<<endl;
		    continue;
		}
		if(k%a[n]==0)
		cout<<k/a[n];
		else{
			ans=k/a[n]+1;
		}
		cout<<max(ans,2)<<endl;
	}
	return 0;
	}


#include <cstdio>
#include <vector>
#include <queue>
#include <cstring>
#include <cmath>
#include <map>
#include <set>
#include <string>
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <stack>
#include <queue>
using namespace std;
#define sd(n) scanf("%d", &n)
#define sdd(n, m) scanf("%d%d", &n, &m)
#define sddd(n, m, k) scanf("%d%d%d", &n, &m, &k)
#define pd(n) printf("%d\n", n)
#define pc(n) printf("%c", n)
#define pdd(n, m) printf("%d %d\n", n, m)
#define pld(n) printf("%lld\n", n)
#define pldd(n, m) printf("%lld %lld\n", n, m)
#define sld(n) scanf("%lld", &n)
#define sldd(n, m) scanf("%lld%lld", &n, &m)
#define slddd(n, m, k) scanf("%lld%lld%lld", &n, &m, &k)
#define sf(n) scanf("%lf", &n)
#define sc(n) scanf("%c", &n)
#define sff(n, m) scanf("%lf%lf", &n, &m)
#define sfff(n, m, k) scanf("%lf%lf%lf", &n, &m, &k)
#define ss(str) scanf("%s", str)
#define rep(i, a, n) for (int i = a; i <= n; i++)
#define per(i, a, n) for (int i = n; i >= a; i--)
#define mem(a, n) memset(a, n, sizeof(a))
#define debug(x) cout << #x << ": " << x << endl
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define fi first
#define se second
#define mod(x) ((x) % MOD)
#define gcd(a, b) __gcd(a, b)
#define lowbit(x) (x & -x)
typedef pair<int, int> PII;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
const int MOD = 1e9 + 7;
const double eps = 1e-9;
const ll INF = 0x3f3f3f3f3f3f3f3fll;
const int inf = 0x3f3f3f3f;
inline int read()
{
    int ret = 0, sgn = 1;
    char ch = getchar();
    while (ch < '0' || ch > '9')
    {
        if (ch == '-')
            sgn = -1;
        ch = getchar();
    }
    while (ch >= '0' && ch <= '9')
    {
        ret = ret * 10 + ch - '0';
        ch = getchar();
    }
    return ret * sgn;
}
inline void Out(int a) //��?3?��a1��
{
    if (a > 9)
        Out(a / 10);
    putchar(a % 10 + '0');
}

ll gcd(ll a, ll b)
{
    return b == 0 ? a : gcd(b, a % b);
}

ll lcm(ll a, ll b)
{
    return a * b / gcd(a, b);
}
///������m^k%mod
ll qpow(ll a, ll b, ll mod)
{
    if (a >= mod)
        a = a % mod + mod;
    ll ans = 1;
    while (b)
    {
        if (b & 1)
        {
            ans = ans * a;
            if (ans >= mod)
                ans = ans % mod + mod;
        }
        a *= a;
        if (a >= mod)
            a = a % mod + mod;
        b >>= 1;
    }
    return ans;
}

// ����������Ԫ
int Fermat(int a, int p) //������a����b����Ԫ
{
    return qpow(a, p - 2, p);
}

///��չŷ�����
ll exgcd(ll a, ll b, ll &x, ll &y)
{
    if (b == 0)
    {
        x = 1;
        y = 0;
        return a;
    }
    ll g = exgcd(b, a % b, x, y);
    ll t = x;
    x = y;
    y = t - a / b * y;
    return g;
}
int n, m, x;
int a[100010];
int ans;
int maxn;
int main()
{
	std::ios::sync_with_stdio(false);
    int t;
    scanf("%d",&t);
    while (t--)
    {
        sdd(n, x);
        maxn = 0;
        ans = 0;
        for(int i=1;i<=n;i++)
        {
            cin>>a[i];
            if (a[i] == x)
                ans = 1;
            maxn = max(a[i], maxn);
        }
        if (ans)
        {
            cout<<ans<<endl;
            continue;
        }
        if (x % maxn == 0)
            ans = x / maxn;
        else
        {
            ans = x / maxn + 1;
        }
        printf("%d",max(ans,2));
    }
    return 0;
}


#include <iostream>
#include <cstdio>
#include <fstream>
#include <algorithm>
#include <cmath>
#include <deque>
#include <vector>
#include <queue>
#include <string>
#include <cstring>
#include <map>
#include <stack>
#include <set>
#include<iomanip>
#define SIS std::ios::sync_with_stdio(false)
#define ll long long
#define INF 0x3f3f3f3f
const int mod = 1e9 + 7;
const double esp = 1e-5;
const double PI = 3.141592653589793238462643383279;
using namespace std;
const int N = 1e7 + 5;
const int maxn = 1 << 20;
/**************************************/
/*
int a[N];
int n, d;
void solve() {
        cin >> n >> d;
		for (int i = 1; i <= n; i++)
		{
			cin >> a[i];
		}
}
int main() {
	int T;
	cin >> T;
	while (T--)
	{
		solve();
		sort(a + 1, a + 1 + n);
		int cnt = 0, flag = INF;
		//int sign = d % a[1];
		for (int i = n; i >= 1; i--)
		{
			cnt = 0;
			if (a[i] <= d)
			{
				//cout<<a[i]<<endl;
				if (d % a[i] == 0)
				{
					cnt += d / a[i];
				}
				else
				{
					cnt += (d / a[i]) + 1;
				}
				flag = min(cnt, flag);
			}
			else
			{
				d = a[i] - d;
			}
		}
		cout << flag << endl;
	}
	return 0;
}*/
int a[N];
int main() {
	int t;
	cin >> t;
	while (t--) {
		int n, d;
		cin >> n >> d;
		for (int i = 1; i <= n; i++)
			cin >> a[i];
		sort(a + 1, a + 1 + n);
		if (d % a[n] == 0)
			cout << d / a[n] << endl;
		else {
			if (d < a[n])
				cout << 2 << endl;
			else
				cout << d / a[n] + 1 << endl;
		}
	}
	return 0;
}


#include <cstdio>
#include <vector>
#include <queue>
#include <cstring>
#include <cmath>
#include <map>
#include <set>
#include <string>
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <stack>
#include <queue>
using namespace std;
#define sd(n) scanf("%d", &n)
#define sdd(n, m) scanf("%d%d", &n, &m)
#define sddd(n, m, k) scanf("%d%d%d", &n, &m, &k)
#define pd(n) printf("%d\n", n)
#define pc(n) printf("%c", n)
#define pdd(n, m) printf("%d %d\n", n, m)
#define pld(n) printf("%lld\n", n)
#define pldd(n, m) printf("%lld %lld\n", n, m)
#define sld(n) scanf("%lld", &n)
#define sldd(n, m) scanf("%lld%lld", &n, &m)
#define slddd(n, m, k) scanf("%lld%lld%lld", &n, &m, &k)
#define sf(n) scanf("%lf", &n)
#define sc(n) scanf("%c", &n)
#define sff(n, m) scanf("%lf%lf", &n, &m)
#define sfff(n, m, k) scanf("%lf%lf%lf", &n, &m, &k)
#define ss(str) scanf("%s", str)
#define rep(i, a, n) for (int i = a; i <= n; i++)
#define per(i, a, n) for (int i = n; i >= a; i--)
#define mem(a, n) memset(a, n, sizeof(a))
#define debug(x) cout << #x << ": " << x << endl
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define fi first
#define se second
#define mod(x) ((x) % MOD)
#define gcd(a, b) __gcd(a, b)
#define lowbit(x) (x & -x)
typedef pair<int, int> PII;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
const int MOD = 1e9 + 7;
const double eps = 1e-9;
const ll INF = 0x3f3f3f3f3f3f3f3fll;
const int inf = 0x3f3f3f3f;
inline int read()
{
    int ret = 0, sgn = 1;
    char ch = getchar();
    while (ch < '0' || ch > '9')
    {
        if (ch == '-')
            sgn = -1;
        ch = getchar();
    }
    while (ch >= '0' && ch <= '9')
    {
        ret = ret * 10 + ch - '0';
        ch = getchar();
    }
    return ret * sgn;
}
inline void Out(int a) //��?3?��a1��
{
    if (a > 9)
        Out(a / 10);
    putchar(a % 10 + '0');
}

ll gcd(ll a, ll b)
{
    return b == 0 ? a : gcd(b, a % b);
}

ll lcm(ll a, ll b)
{
    return a * b / gcd(a, b);
}
///������m^k%mod
ll qpow(ll a, ll b, ll mod)
{
    if (a >= mod)
        a = a % mod + mod;
    ll ans = 1;
    while (b)
    {
        if (b & 1)
        {
            ans = ans * a;
            if (ans >= mod)
                ans = ans % mod + mod;
        }
        a *= a;
        if (a >= mod)
            a = a % mod + mod;
        b >>= 1;
    }
    return ans;
}

// ����������Ԫ
int Fermat(int a, int p) //������a����b����Ԫ
{
    return qpow(a, p - 2, p);
}

///��չŷ�����
ll exgcd(ll a, ll b, ll &x, ll &y)
{
    if (b == 0)
    {
        x = 1;
        y = 0;
        return a;
    }
    ll g = exgcd(b, a % b, x, y);
    ll t = x;
    x = y;
    y = t - a / b * y;
    return g;
}
int n, m, x;
int a[100010];
int ans;
int maxn;
int main()
{
	std::ios::sync_with_stdio(false);
    int t;
    scanf("%d",&t);
    while (t--)
    {
        sdd(n, x);
        maxn = 0;
        ans = 0;
        for(int i=1;i<=n;i++)
        {
            cin>>a[i];
            if (a[i] == x)
                ans = 1;
            maxn = max(a[i], maxn);
        }
        if (ans)
        {
            cout<<ans<<endl;
            continue;
        }
        if (x % maxn == 0)
            ans = x / maxn;
        else
        {
            ans = x / maxn + 1;
        }
        printf("%d\n",max(ans,2));
    }
    return 0;
}


#include <iostream>
#include <cstdio>
#include <fstream>
#include <algorithm>
#include <cmath>
#include <deque>
#include <vector>
#include <queue>
#include <string>
#include <cstring>
#include <map>
#include <stack>
#include <set>
#include<iomanip>
#define SIS std::ios::sync_with_stdio(false)
#define ll long long
#define INF 0x3f3f3f3f
const int mod = 1e9 + 7;
const double esp = 1e-5;
const double PI = 3.141592653589793238462643383279;
using namespace std;
const int N = 1e7 + 5;
const int maxn = 1 << 20;
/**************************************/
/*
int a[N];
int n, d;
void solve() {
        cin >> n >> d;
		for (int i = 1; i <= n; i++)
		{
			cin >> a[i];
		}
}
int main() {
	int T;
	cin >> T;
	while (T--)
	{
		solve();
		sort(a + 1, a + 1 + n);
		int cnt = 0, flag = INF;
		//int sign = d % a[1];
		for (int i = n; i >= 1; i--)
		{
			cnt = 0;
			if (a[i] <= d)
			{
				//cout<<a[i]<<endl;
				if (d % a[i] == 0)
				{
					cnt += d / a[i];
				}
				else
				{
					cnt += (d / a[i]) + 1;
				}
				flag = min(cnt, flag);
			}
			else
			{
				d = a[i] - d;
			}
		}
		cout << flag << endl;
	}
	return 0;
}*/
int a[N];
int main() {
	SIS;
	int t;
	cin >> t;
	while (t--) {
		int n, d;
		cin >> n >> d;
		int ansn=0;
		for (int i = 1; i <= n; i++){
			cin >> a[i];
			if(a[i]==d)
			ansn=1;
		}

		sort(a + 1, a + 1 + n);
		int ans = INF, flag = 0;
		if (d % a[n] == 0)
			cout << d / a[n] << endl;
		else {
		for (int i = 1; i <= n; i++)
		{
			if (d % a[i] == 0)
			{
				ans = min(ans, d / a[i]);
			}
		}
		int ans2 = 0;
		while (d > (2 * a[n])) {
			d = d - a[n];
			ans2++;
		}
		ans2 += 2;
		if(ansn==1)
		cout<<1<<endl;
		else
		cout << min(ans, ans2) << endl;
		}
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int a[1000005];
int main(){
	int t;
	cin>>t;
	while(t--){
		int n,k;
		int sign=0;
		cin>>n>>k;
		for(int i=1;i<=n;i++){
			cin>>a[i];
			if(k==a[i])
			sign=1;
		}
		sort(a+1,a+1+n);
		if(sign==1){
			cout<<1<<endl;
		    continue;
		}
		if(k%a[n]==0)
		cout<<k/a[n];
		else{
			if(k<a[n])
			cout<<2<<endl;
			else
			cout<<k/a[n]+1<<endl;
		}
	}
	return 0;
	}


#include <cstdio>
#include <vector>
#include <queue>
#include <cstring>
#include <cmath>
#include <map>
#include <set>
#include <string>
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <stack>
#include <queue>
using namespace std;
const int MOD = 1e9 + 7;
const double eps = 1e-9;
const int inf = 0x3f3f3f3f;
int n, m, x;
int a[100010];
int ans;
int maxn;
int main()
{
	std::ios::sync_with_stdio(false);
    int t;
    cin>>t;
    while (t--)
    {
       cin>>n>>x;
        maxn = 0;
        ans = 0;
        for(int i=1;i<=n;i++)
        {
            cin>>a[i];
            if (a[i] == x)
                ans = 1;
            maxn = max(a[i], maxn);
        }
        if (ans)
        {
            cout<<ans<<endl;
            continue;
        }
        if (x % maxn == 0)
            ans = x / maxn;
        else
        {
            ans = x / maxn + 1;
        }
        printf("%d\n",max(ans,2));
    }
    return 0;
}


#include <cstdio>
#include <vector>
#include <queue>
#include <cstring>
#include <cmath>
#include <map>
#include <set>
#include <string>
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <stack>
#include <queue>
using namespace std;
#define sd(n) scanf("%d", &n)
#define sdd(n, m) scanf("%d%d", &n, &m)
#define sddd(n, m, k) scanf("%d%d%d", &n, &m, &k)
#define pd(n) printf("%d\n", n)
#define pc(n) printf("%c", n)
#define pdd(n, m) printf("%d %d\n", n, m)
#define pld(n) printf("%lld\n", n)
#define pldd(n, m) printf("%lld %lld\n", n, m)
#define sld(n) scanf("%lld", &n)
#define sldd(n, m) scanf("%lld%lld", &n, &m)
#define slddd(n, m, k) scanf("%lld%lld%lld", &n, &m, &k)
#define sf(n) scanf("%lf", &n)
#define sc(n) scanf("%c", &n)
#define sff(n, m) scanf("%lf%lf", &n, &m)
#define sfff(n, m, k) scanf("%lf%lf%lf", &n, &m, &k)
#define ss(str) scanf("%s", str)
#define rep(i, a, n) for (int i = a; i <= n; i++)
#define per(i, a, n) for (int i = n; i >= a; i--)
#define mem(a, n) memset(a, n, sizeof(a))
#define debug(x) cout << #x << ": " << x << endl
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define fi first
#define se second
#define mod(x) ((x) % MOD)
#define gcd(a, b) __gcd(a, b)
#define lowbit(x) (x & -x)
typedef pair<int, int> PII;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
const int MOD = 1e9 + 7;
const double eps = 1e-9;
const ll INF = 0x3f3f3f3f3f3f3f3fll;
const int inf = 0x3f3f3f3f;
inline int read()
{
    int ret = 0, sgn = 1;
    char ch = getchar();
    while (ch < '0' || ch > '9')
    {
        if (ch == '-')
            sgn = -1;
        ch = getchar();
    }
    while (ch >= '0' && ch <= '9')
    {
        ret = ret * 10 + ch - '0';
        ch = getchar();
    }
    return ret * sgn;
}
inline void Out(int a) //��?3?��a1��
{
    if (a > 9)
        Out(a / 10);
    putchar(a % 10 + '0');
}

ll gcd(ll a, ll b)
{
    return b == 0 ? a : gcd(b, a % b);
}

ll lcm(ll a, ll b)
{
    return a * b / gcd(a, b);
}
///������m^k%mod
ll qpow(ll a, ll b, ll mod)
{
    if (a >= mod)
        a = a % mod + mod;
    ll ans = 1;
    while (b)
    {
        if (b & 1)
        {
            ans = ans * a;
            if (ans >= mod)
                ans = ans % mod + mod;
        }
        a *= a;
        if (a >= mod)
            a = a % mod + mod;
        b >>= 1;
    }
    return ans;
}

// ����������Ԫ
int Fermat(int a, int p) //������a����b����Ԫ
{
    return qpow(a, p - 2, p);
}

///��չŷ�����
ll exgcd(ll a, ll b, ll &x, ll &y)
{
    if (b == 0)
    {
        x = 1;
        y = 0;
        return a;
    }
    ll g = exgcd(b, a % b, x, y);
    ll t = x;
    x = y;
    y = t - a / b * y;
    return g;
}
int n, m, x;
int a[100010];
int ans;
int maxn;
int main()
{
	std::ios::sync_with_stdio(false);
    int t;
    scanf("%d",&t);
    while (t--)
    {
        cin>>n>>x;
        maxn = 0;
        ans = 0;
        for(int i=1;i<=n;i++)
        {
            cin>>a[i];
            if (a[i] == x)
                ans = 1;
            maxn = max(a[i], maxn);
        }
        if (ans)
        {
            cout<<ans<<endl;
            continue;
        }
        if (x % maxn == 0)
            ans = x / maxn;
        else
        {
            ans = x / maxn + 1;
        }
        printf("%d\n",max(ans,2));
    }
    return 0;
}


#include <iostream>
#include <cstdio>
#include <fstream>
#include <algorithm>
#include <cmath>
#include <deque>
#include <vector>
#include <queue>
#include <string>
#include <cstring>
#include <map>
#include <stack>
#include <set>
#include<iomanip>
#define SIS std::ios::sync_with_stdio(false)
#define ll long long
#define INF 0x3f3f3f3f
const int mod = 1e9 + 7;
const double esp = 1e-5;
const double PI = 3.141592653589793238462643383279;
using namespace std;
const int N = 1e7 + 5;
const int maxn = 1 << 20;
/**************************************/
/*
int a[N];
int n, d;
void solve() {
        cin >> n >> d;
		for (int i = 1; i <= n; i++)
		{
			cin >> a[i];
		}
}
int main() {
	int T;
	cin >> T;
	while (T--)
	{
		solve();
		sort(a + 1, a + 1 + n);
		int cnt = 0, flag = INF;
		//int sign = d % a[1];
		for (int i = n; i >= 1; i--)
		{
			cnt = 0;
			if (a[i] <= d)
			{
				//cout<<a[i]<<endl;
				if (d % a[i] == 0)
				{
					cnt += d / a[i];
				}
				else
				{
					cnt += (d / a[i]) + 1;
				}
				flag = min(cnt, flag);
			}
			else
			{
				d = a[i] - d;
			}
		}
		cout << flag << endl;
	}
	return 0;
}*/
int a[N];
int main() {
	int t;
	cin >> t;
	while (t--) {
		int n, d;
		cin >> n >> d;
		for (int i = 1; i <= n; i++)
			cin >> a[i];
		sort(a + 1, a + 1 + n);
		int ans = INF, flag = 0;
		if (d % a[n] == 0)
			cout << d / a[n] << endl;
		else {
		for (int i = 1; i <= n; i++)
		{
			if (d % a[i] == 0)
			{
				ans = min(ans, d / a[i]);
			}
		}
		int ans2 = 0;
		while (d > (2 * a[n])) {
			d = d - a[n];
			ans2++;
		}
		ans2 += 2;
		cout << min(ans, ans2) << endl;
		}
	}
	return 0;
}


#include <iostream>
#include <cstdio>
#include <fstream>
#include <algorithm>
#include <cmath>
#include <deque>
#include <vector>
#include <queue>
#include <string>
#include <cstring>
#include <map>
#include <stack>
#include <set>
#include<iomanip>
#define SIS std::ios::sync_with_stdio(false)
#define ll long long
#define INF 0x3f3f3f3f
const int mod = 1e9 + 7;
const double esp = 1e-5;
const double PI = 3.141592653589793238462643383279;
using namespace std;
const int N = 1e7 + 5;
const int maxn = 1 << 20;
/**************************************/
/*
int a[N];
int n, d;
void solve() {
        cin >> n >> d;
		for (int i = 1; i <= n; i++)
		{
			cin >> a[i];
		}
}
int main() {
	int T;
	cin >> T;
	while (T--)
	{
		solve();
		sort(a + 1, a + 1 + n);
		int cnt = 0, flag = INF;
		//int sign = d % a[1];
		for (int i = n; i >= 1; i--)
		{
			cnt = 0;
			if (a[i] <= d)
			{
				//cout<<a[i]<<endl;
				if (d % a[i] == 0)
				{
					cnt += d / a[i];
				}
				else
				{
					cnt += (d / a[i]) + 1;
				}
				flag = min(cnt, flag);
			}
			else
			{
				d = a[i] - d;
			}
		}
		cout << flag << endl;
	}
	return 0;
}*/
int a[N];
int main() {
	int t;
	scanf("%d",&t);
	while (t--) {
		int n, d;
		cin >> n >> d;
		for (int i = 1; i <= n; i++)
			scanf("%d",&a[i]);
		sort(a + 1, a + 1 + n);
		int ans = INF, flag = 0;
		if (d % a[n] == 0)
			printf("%d\n",d/a[n]);
		else {
		for (int i = 1; i <= n; i++)
		{
			if (d % a[i] == 0)
			{
				ans = min(ans, d / a[i]);
			}
		}
		int ans2 = 0;
		while (d > (2 * a[n])) {
			d = d - a[n];
			ans2++;
		}
		ans2 += 2;
		printf("%d\n",min(ans,ans2));
		}
	}
	return 0;
}


#include <iostream>
#include <cstdio>
#include <fstream>
#include <algorithm>
#include <cmath>
#include <deque>
#include <vector>
#include <queue>
#include <string>
#include <cstring>
#include <map>
#include <stack>
#include <set>
#include<iomanip>
#define SIS std::ios::sync_with_stdio(false)
#define ll long long
#define INF 0x3f3f3f3f
const int mod = 1e9 + 7;
const double esp = 1e-5;
const double PI = 3.141592653589793238462643383279;
using namespace std;
const int N = 1e7 + 5;
const int maxn = 1 << 20;
/**************************************/
/*
int a[N];
int n, d;
void solve() {
        cin >> n >> d;
		for (int i = 1; i <= n; i++)
		{
			cin >> a[i];
		}
}
int main() {
	int T;
	cin >> T;
	while (T--)
	{
		solve();
		sort(a + 1, a + 1 + n);
		int cnt = 0, flag = INF;
		//int sign = d % a[1];
		for (int i = n; i >= 1; i--)
		{
			cnt = 0;
			if (a[i] <= d)
			{
				//cout<<a[i]<<endl;
				if (d % a[i] == 0)
				{
					cnt += d / a[i];
				}
				else
				{
					cnt += (d / a[i]) + 1;
				}
				flag = min(cnt, flag);
			}
			else
			{
				d = a[i] - d;
			}
		}
		cout << flag << endl;
	}
	return 0;
}*/
int a[N];
int main() {
	int t;
	cin >> t;
	while (t--) {
		int n, d;
		cin >> n >> d;
		int ansn=0;
		for (int i = 1; i <= n; i++){
			cin >> a[i];
			if(a[i]==d)
			ansn=1;
		}

		sort(a + 1, a + 1 + n);
		int ans = INF, flag = 0;
		if (d % a[n] == 0)
			cout << d / a[n] << endl;
		else {
		for (int i = 1; i <= n; i++)
		{
			if (d % a[i] == 0)
			{
				ans = min(ans, d / a[i]);
			}
		}
		int ans2 = 0;
		while (d > (2 * a[n])) {
			d = d - a[n];
			ans2++;
		}
		ans2 += 2;
		if(ansn==1)
		cout<<1<<endl;
		else
		cout << min(ans, ans2) << endl;
		}
	}
	return 0;
}


#include <cstdio>
#include <vector>
#include <queue>
#include <cstring>
#include <cmath>
#include <map>
#include <set>
#include <string>
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <stack>
#include <queue>
using namespace std;
#define sd(n) scanf("%d", &n)
#define sdd(n, m) scanf("%d%d", &n, &m)
#define sddd(n, m, k) scanf("%d%d%d", &n, &m, &k)
#define pd(n) printf("%d\n", n)
#define pc(n) printf("%c", n)
#define pdd(n, m) printf("%d %d\n", n, m)
#define pld(n) printf("%lld\n", n)
#define pldd(n, m) printf("%lld %lld\n", n, m)
#define sld(n) scanf("%lld", &n)
#define sldd(n, m) scanf("%lld%lld", &n, &m)
#define slddd(n, m, k) scanf("%lld%lld%lld", &n, &m, &k)
#define sf(n) scanf("%lf", &n)
#define sc(n) scanf("%c", &n)
#define sff(n, m) scanf("%lf%lf", &n, &m)
#define sfff(n, m, k) scanf("%lf%lf%lf", &n, &m, &k)
#define ss(str) scanf("%s", str)
#define rep(i, a, n) for (int i = a; i <= n; i++)
#define per(i, a, n) for (int i = n; i >= a; i--)
#define mem(a, n) memset(a, n, sizeof(a))
#define debug(x) cout << #x << ": " << x << endl
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define fi first
#define se second
#define mod(x) ((x) % MOD)
#define gcd(a, b) __gcd(a, b)
#define lowbit(x) (x & -x)
typedef pair<int, int> PII;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
const int MOD = 1e9 + 7;
const double eps = 1e-9;
const ll INF = 0x3f3f3f3f3f3f3f3fll;
const int inf = 0x3f3f3f3f;
inline int read()
{
    int ret = 0, sgn = 1;
    char ch = getchar();
    while (ch < '0' || ch > '9')
    {
        if (ch == '-')
            sgn = -1;
        ch = getchar();
    }
    while (ch >= '0' && ch <= '9')
    {
        ret = ret * 10 + ch - '0';
        ch = getchar();
    }
    return ret * sgn;
}
inline void Out(int a) //��?3?��a1��
{
    if (a > 9)
        Out(a / 10);
    putchar(a % 10 + '0');
}

ll gcd(ll a, ll b)
{
    return b == 0 ? a : gcd(b, a % b);
}

ll lcm(ll a, ll b)
{
    return a * b / gcd(a, b);
}
///������m^k%mod
ll qpow(ll a, ll b, ll mod)
{
    if (a >= mod)
        a = a % mod + mod;
    ll ans = 1;
    while (b)
    {
        if (b & 1)
        {
            ans = ans * a;
            if (ans >= mod)
                ans = ans % mod + mod;
        }
        a *= a;
        if (a >= mod)
            a = a % mod + mod;
        b >>= 1;
    }
    return ans;
}

// ����������Ԫ
int Fermat(int a, int p) //������a����b����Ԫ
{
    return qpow(a, p - 2, p);
}

///��չŷ�����
ll exgcd(ll a, ll b, ll &x, ll &y)
{
    if (b == 0)
    {
        x = 1;
        y = 0;
        return a;
    }
    ll g = exgcd(b, a % b, x, y);
    ll t = x;
    x = y;
    y = t - a / b * y;
    return g;
}
int n, m, x;
int a[100010];
int ans;
int maxn;
int main()
{
    int t;
    sd(t);
    while (t--)
    {
        sdd(n, x);
        maxn = 0;
        ans = 0;
        rep(i, 1, n)
        {
            sd(a[i]);
            if (a[i] == x)
                ans = 1;
            maxn = max(a[i], maxn);
        }
        if (ans)
        {
            pd(ans);
            continue;
        }
        if (x % maxn == 0)
            ans = x / maxn;
        else
        {
            ans = x / maxn + 1;
        }
        pd(max(ans, 2));
    }
    return 0;
}


#include<bits/stdc++.h>
#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<algorithm>
#include<stack>
#include<queue>
#define INF 0x3f3f3f3f
#define lowbit(x) x & -x
#define lson root<<1,l,mid
#define rson root<<1|1,mid+1,r
using namespace std;
typedef long long ll;
const int mod=1e9+7;
const int N=1e5+5;
int a[N];
map<int,bool>mp;
int main(){
#ifdef Mizp
    freopen("in.txt","r",stdin);
#endif
    int T;
    scanf("%d",&T);
    while(T--){
        int n,x;
        scanf("%d%d",&n,&x);
        int maxx=0,flag=INF;
        for(int i=1;i<=n;i++){
            scanf("%d",&a[i]);
            if(x%a[i]==0){
                flag=x/a[i];
            }
            mp[a[i]]=true;
            maxx=max(a[i],maxx);
        }
        if(x%maxx){
            if(mp[x%maxx])
                maxx=min(x/maxx+1,flag);
            else
                maxx=min(x/maxx+2,flag);
            printf("%d\n",maxx);
        }else{
            printf("%d\n",x/maxx);
        }
    }
    return 0;
}


#include<bits/stdc++.h>
#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<algorithm>
#include<stack>
#include<queue>
#define INF 0x3f3f3f3f
#define lowbit(x) x & -x
#define lson root<<1,l,mid
#define rson root<<1|1,mid+1,r
using namespace std;
typedef long long ll;
const int mod=1e9+7;
const int N=1e5+5;
int a[N];
int main(){
#ifdef Mizp
    freopen("in.txt","r",stdin);
#endif
    int T;
    scanf("%d",&T);
    while(T--){
        int n,x;
        scanf("%d%d",&n,&x);
        int maxx=0,flag=0;
        for(int i=1;i<=n;i++){
            scanf("%d",&a[i]);
            if(x==a[i]){
                flag=1;
            }
            maxx=max(a[i],maxx);
        }
        if(flag){
            puts("1");
        }else{
            printf("%d\n",max(2,(x+maxx-1)/maxx));
        }

    }
    return 0;
}


#include<bits/stdc++.h>
#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<algorithm>
#include<stack>
#include<queue>
#define INF 0x3f3f3f3f
#define lowbit(x) x & -x
#define lson root<<1,l,mid
#define rson root<<1|1,mid+1,r
using namespace std;
typedef long long ll;
const int mod=1e9+7;
const int N=1e5+5;
int a[N];
map<int,bool>mp;
int main(){
#ifdef Mizp
    freopen("in.txt","r",stdin);
#endif
    int T;
    scanf("%d",&T);
    while(T--){
        int n,x;
        scanf("%d%d",&n,&x);
        int maxx=0,flag=INF;
        for(int i=1;i<=n;i++){
            scanf("%d",&a[i]);
            if(x%a[i]==0){
                flag=x/a[i];
            }
            mp[a[i]]=true;
            maxx=max(a[i],maxx);
        }
        if(x%maxx){
            if(mp[x%maxx])
                maxx=min(x/maxx+1,flag);
            else
                maxx=min(x/maxx+2,flag);
            printf("%d\n",maxx);
        }else{
            puts("1");
        }
    }
    return 0;
}


#include<bits/stdc++.h>
#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<algorithm>
#include<stack>
#include<queue>
#define INF 0x3f3f3f3f
#define lowbit(x) x & -x
#define lson root<<1,l,mid
#define rson root<<1|1,mid+1,r
using namespace std;
typedef long long ll;
const int mod=1e9+7;
const int N=1e5+5;
int a[N];
int main(){
#ifdef Mizp
    freopen("in.txt","r",stdin);
#endif
    int T;
    scanf("%d",&T);
    while(T--){
        int n,x;
        scanf("%d%d",&n,&x);
        int maxx=0,flag=INF;
        for(int i=1;i<=n;i++){
            scanf("%d",&a[i]);
            if(x%a[i]==0){
                flag=x/a[i];
            }
            maxx=max(a[i],maxx);
        }
        if(x%maxx){
            if(maxx<x)
                maxx=min(x/maxx+1,flag);
            else
                maxx=min(x/maxx+2,flag);
            printf("%d\n",maxx);
        }else{
            printf("%d\n",x/maxx);
        }
    }
    return 0;
}


#include<bits/stdc++.h>
#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<algorithm>
#include<stack>
#include<queue>
#define INF 0x3f3f3f3f
#define lowbit(x) x & -x
#define lson root<<1,l,mid
#define rson root<<1|1,mid+1,r
using namespace std;
typedef long long ll;
const int mod=1e9+7;
const int N=1e5+5;
int a[N];
map<int,bool>mp;
int main(){
#ifdef Mizp
    freopen("in.txt","r",stdin);
#endif
    int T;
    scanf("%d",&T);
    while(T--){
        int n,x;
        mp.clear();
        scanf("%d%d",&n,&x);
        int maxx=0,flag=INF;
        for(int i=1;i<=n;i++){
            scanf("%d",&a[i]);
            if(x%a[i]==0){
                flag=x/a[i];
            }
            mp[a[i]]=true;
            maxx=max(a[i],maxx);
        }
        if(x%maxx){
            if(mp[x%maxx])
                maxx=min(x/maxx+1,flag);
            else
                maxx=min(x/maxx+2,flag);
            printf("%d\n",maxx);
        }else{
            printf("%d\n",x/maxx);
        }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        long long n,x,y,maxi=0,sum=0;
        cin>>n>>x;
        for(int i=0; i<n; i++)
        {
            cin>>y;
            if(y==x)
                sum = 1;
            maxi = max(y,maxi);
        }
        if(sum)
        {
            cout<<sum<<endl;
            continue;
        }
        if(x<maxi)
            swap(x,maxi);
        long long ind = ceil(x/maxi);
        cout<<ind+1<<endl;
    }
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        long long n,x,y,maxi=0,sum=0;
        cin>>n>>x;
        for(int i=0; i<n; i++)
        {
            cin>>y;
            if(y==x)
                sum = 1;
            maxi = max(y,maxi);
        }
        if(sum)
        {
            cout<<sum<<endl;
            continue;
        }
        sum = ceil(x/maxi);
        long long ind = max(2,sum);
        cout<<ind<<endl;
    }
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        long long n,x,y,maxi=0,sum=0;
        cin>>n>>x;
        for(int i=0; i<n; i++)
        {
            cin>>y;
            if(y==x)
                sum = 1;
            maxi = max(y,maxi);
        }
        if(sum)
        {
            cout<<sum<<endl;
            continue;
        }
        sum = (x+maxi-1)/maxi;
        if(sum<2)
            cout<<2<<endl;
        else
            cout<<sum<<endl;
    }
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        long long n,x,y,maxi=0,sum=0;
        cin>>n>>x;
        for(int i=0; i<n; i++)
        {
            cin>>y;
            if(y==x)
                sum = 1;
            maxi = max(y,maxi);
        }
        if(sum)
        {
            cout<<sum<<endl;
            continue;
        }

        long long ind = max(2,ceil(x/maxi));
        cout<<ind<<endl;
    }
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        long long n,x,y,maxi=0,sum=0;
        cin>>n>>x;
        for(int i=0; i<n; i++)
        {
            cin>>y;
            if(y==x)
                sum = 1;
            maxi = max(y,maxi);
        }
        if(sum)
        {
            cout<<sum<<endl;
            continue;
        }
        sum = ceil(x/maxi);
        if(sum<2)
            cout<<2<<endl;
        else
            cout<<sum<<endl;
    }
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        long long n,x,y,maxi=0,sum=0;
        cin>>n>>x;
        for(int i=0; i<n; i++)
        {
            cin>>y;
            if(y==x)
                sum = 1;
            maxi = max(y,maxi);
        }
        if(sum)
        {
            cout<<sum<<endl;
            continue;
        }

        long long ind = x/maxi;
        cout<<ind+1<<endl;
    }
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        long long n,x,y,maxi=0,sum=0;
        cin>>n>>x;
        for(int i=0; i<n; i++)
        {
            cin>>y;
            if(y==x)
                sum = 1;
            maxi = max(y,maxi);
        }
        if(sum)
        {
            cout<<sum<<endl;
            continue;
        }
        sum = maxi*2;
        long long ind = 2;
        while(sum<=x)
        {
            sum+=maxi;
            ind++;
        }
        cout<<ind<<endl;
    }
}


#include"bits/stdc++.h"
using namespace std;
#define ll long long
inline int read(){
	int x=0,flag=1;
	char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-') flag=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){x=x*10+(ch^48);ch=getchar();}
	return x*flag;
}
int t,n,x,a[100010];
int main()
{
	t=read();
	while(t--)
	{
		n=read(),x=read();
		int flag=0;
		for(register int i=1;i<=n;++i)
		{
			a[i]=read();if(a[i]==x) flag=1;
		}
		if(flag==1)
		{
			puts("1");
			continue;
		}
		sort(a+1,a+1+n);
		if(a[n]>x)
		{
			puts("2");
			continue;
		}
		ll res = 0;
		for(register int i=n;i>=1;--i)
		{
			res += a[i];
			if(res>=x)
			{
				flag=i;
				break;
			}
		}
		cout<<n-flag+1<<endl;
	}
    return 0;
}


#include"bits/stdc++.h"
using namespace std;
#define ll long long
inline ll read(){
	ll x=0,flag=1;
	char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-') flag=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){x=x*10+(ch^48);ch=getchar();}
	return x*flag;
}
int t,n,x,a[100010];
int main()
{
	t=read();
	while(t--)
	{
		n=read(),x=read();
		int maxn = 0;
		int flag=0;
		for(register int i=1;i<=n;++i)
		{
			a[i]=read();if(a[i]==x) flag=1;
			maxn = max(maxn,a[i]);
		}
		if(flag==1)
		{
			puts("1");
			continue;
		}
		std::cout<<max(2,(maxn+x-1)/maxn)<<endl;
	}
    return 0;
}


#include"bits/stdc++.h"
using namespace std;
#define ll long long
inline ll read(){
	ll x=0,flag=1;
	char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-') flag=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){x=x*10+(ch^48);ch=getchar();}
	return x*flag;
}
ll t,n,x,a[100010];
int main()
{
	t=read();
	while(t--)
	{
		n=read(),x=read();
		int flag=0;
		for(register int i=1;i<=n;++i)
		{
			a[i]=read();if(a[i]==x) flag=1;
		}
		if(flag==1)
		{
			puts("1");
			continue;
		}
		sort(a+1,a+1+n);
		if(a[n]>x)
		{
			puts("2");
			continue;
		}
		ll res = 0;
		for(register int i=n;i>=1;--i)
		{
			res += a[i];
			if(res>=x)
			{
				flag=i;
				break;
			}
		}
		cout<<n-flag+1<<endl;
	}
    return 0;
}


#include"bits/stdc++.h"
using namespace std;
#define ll long long
#define ul unsigned long long
#define ui unsigned int
#define ri register int
#define pb push_back
char p[30]={'0','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
inline int rd(){
	int x=0,flag=1;
	char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-') flag=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){x=x*10+(ch^48);ch=getchar();}
	return x*flag;
}
int t,x,n;
inline int lowbit(int x){return x & ( - x ) ;}
int main()
{
	t=rd();
	while(t--)
	{
		n=rd(),x=rd();int flg=0,mx=0;
		for(ri i=1;i<=n;++i)
		{
			int l=rd();mx=max(mx,l);
			if(l==x) {cout<<1<<endl;flg=1;break;}
		}
		if(flg) continue;
		if(mx>x) {puts("2");continue;}
		cout<<(x+mx-1)/mx<<endl;
	}
    return 0;
}


#include"bits/stdc++.h"
using namespace std;
#define ll long long
#define ul unsigned long long
#define ui unsigned int
#define ri register int
#define pb push_back
char p[30]={'0','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
inline int rd(){
	int x=0,flag=1;
	char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-') flag=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){x=x*10+(ch^48);ch=getchar();}
	return x*flag;
}
int t,x,n;
inline int lowbit(int x){return x & ( - x ) ;}
signed main()
{
	t=rd();
	while(t--)
	{
		cin>>n>>x;
		int flg=0,mx=0;
		for(ri i=1;i<=n;++i)
		{
			int l=rd();mx=max(mx,l);
			if(l==x) flg=1;
		}
		if(flg==1)
		{
			puts("1");
			continue;
		}
		else printf("%d\n",max(2,(mx+x-1)/mx));
	}
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

typedef long long LL;

const int N=100000;

int n;
LL m,a[N+9];

void work(){
  scanf("%d%lld",&n,&m);
  LL ans=m;
  for (int i=1;i<=n;++i){
	scanf("%lld",&a[i]);
	if (a[i]==m) ans=min(ans,1LL);
  }
  sort(a+1,a+n+1);
  if (a[n]>m) ans=min(ans,2LL);
  else ans=min(ans,m%a[n]==0?m/a[n]:m/a[n]+1);
  printf("%lld\n",ans);
}

int main(){
  int T;
  scanf("%d",&T);
  for (;T--;) work();
  return 0;
}


#include<bits/stdc++.h>
using namespace std;

typedef long long LL;

const int N=100000;

int n;
LL m,a[N+9];

void work(){
  scanf("%d%lld",&n,&m);
  for (int i=1;i<=n;++i)
	scanf("%lld",&a[i]);
  sort(a+1,a+n+1);
  LL sum=0;
  int ans=n,p=0;
  for (int i=1;i<=n;++i)
	if (a[i]<=m) p=i;
  for (int i=p;i>=1;--i)
	if ((sum+=a[i])>=m) ans=min(ans,p-i+1);
  sum=m;
  for (int i=1;i<p;++i) sum+=a[i];
  for (int l=1,r=p+1;r<=n;++r){
	sum+=a[r-1];
	for (;l<r&&sum-a[l]>=a[r];++l) sum-=a[l];
	if (sum>=a[r]) ans=min(ans,r-l+1);
  }
  printf("%d\n",ans);
}

int main(){
  int T;
  scanf("%d",&T);
  for (;T--;) work();
  return 0;
}


#include<bits/stdc++.h>
using namespace std;

typedef long long LL;

const int N=100000;

int n;
LL m,a[N+9];

void work(){
  scanf("%d%lld",&n,&m);
  for (int i=1;i<=n;++i)
	scanf("%lld",&a[i]);
  sort(a+1,a+n+1);
  int l,r;
  LL sum=0;
  int ans=n;
  int p;
  for (int i=1;i<=n;++i)
	if (a[i]<=m) p=i;
  for (int i=p;i>=1;--i)
	if ((sum+=a[i])>=m) ans=min(ans,p-i+1);
  sum=m;
  for (int i=1;i<p;++i) sum+=a[i];
  for (int l=1,r=p+1;r<=n;++r){
	sum+=a[r-1];
	for (;l<r&&sum-a[l]>=a[r];++l) sum-=a[l];
	if (sum>=a[r]) ans=min(ans,r-l+1);
  }
  printf("%d\n",ans);
}

int main(){
  int T;
  scanf("%d",&T);
  for (;T--;) work();
  return 0;
}


#include<bits/stdc++.h>
using namespace std;

typedef long long LL;

const int N=100000;

int n;
LL m,a[N+9];

void work(){
  scanf("%d%lld",&n,&m);
  LL ans=n;
  if (!m) ans=0;
  for (int i=1;i<=n;++i){
	scanf("%lld",&a[i]);
	if (a[i]==m) ans=min(ans,1LL);
  }
  sort(a+1,a+n+1);
  if (a[n]>=m) ans=min(ans,2LL);
  else ans=min(ans,m%a[n]==0?m/a[n]:m/a[n]+1);
  printf("%lld\n",ans);
}

int main(){
  int T;
  scanf("%d",&T);
  for (;T--;) work();
  return 0;
}


#include<bits/stdc++.h>
using namespace std;

typedef long long LL;

const int N=100000;

int n;
LL m,a[N+9];

void work(){
  scanf("%d%lld",&n,&m);
  for (int i=1;i<=n;++i)
	scanf("%lld",&a[i]);
  sort(a+1,a+n+1);
  int l,r;
  LL sum=m;
  int ans=n;
  for (r=1;r<=n&&a[r]<=m;++r);--r;
  for (int i=r;i>=1;--i)
	if ((sum-=a[i])<=0) ans=min(ans,r-i+1);
  sum=m;
  if (++r<=n)
  for (l=r-1;l>=1;--l) if ((sum+=a[l])>=a[r]) {ans=min(ans,r-l+1);break;}
  for (++r;r<=n;++r){
	sum+=a[r-1];
	for (;l<r&&sum-a[l]>=a[r];++l);
	if (sum>=a[r]) ans=min(ans,r-l+1);
  }
  printf("%d\n",ans);
}

int main(){
  int T;
  scanf("%d",&T);
  for (;T--;) work();
  return 0;
}


#include<bits/stdc++.h>
using namespace std;

typedef long long LL;

const int N=100000;
const LL INF=(1LL<<60)-1;

int n;
LL m,a[N+9];

void work(){
  scanf("%d%lld",&n,&m);
  LL ans=INF;
  for (int i=1;i<=n;++i){
	scanf("%lld",&a[i]);
	if (a[i]==m) ans=min(ans,1LL);
	if (a[i]>m) ans=min(ans,2LL);
	if (a[i]<m) ans=min(ans,(m+a[i]-1)/a[i]);
  }
  printf("%lld\n",ans);
}

int main(){
  int T;
  scanf("%d",&T);
  for (;T--;) work();
  return 0;
}


#include<bits/stdc++.h>
using namespace std;

typedef long long LL;

const int N=100000;

int n;
LL m,a[N+9];

void work(){
  scanf("%d%lld",&n,&m);
  for (int i=1;i<=n;++i)
	scanf("%lld",&a[i]);
  sort(a+1,a+n+1);
  int l,r;
  LL sum=m;
  int ans=n;
  for (r=1;r<=n&&a[r]<=m;++r);--r;
  for (int i=r;i>=1;--i)
	if ((sum-=a[i])<=0) ans=min(ans,r-i+1);
  sum=m;
  if (++r<=n)
  for (l=r-1;l>=1;--l) if ((sum+=a[l])>=a[r]) {ans=min(ans,r-l+1);break;}
  for (++r;r<=n;++r){
	sum+=a[r-1];
	for (;l<r&&sum-a[l]>=a[r];++l) sum-=a[l];
	if (sum>=a[r]) ans=min(ans,r-l+1);
  }
  printf("%d\n",ans);
}

int main(){
  int T;
  scanf("%d",&T);
  for (;T--;) work();
  return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define FOR_OPEN(NAME, A, B) for (int NAME = A; NAME < B; ++NAME)
#define FOR_CLOSE(NAME, A, B) for (int NAME = A; NAME <= B; ++NAME)
#define endl '\n'
using ll = long long;

/*

*/
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);

    int T;
    cin >> T;
    while (T--)
    {
        int N, X;
        cin >> N >> X;
        int m = 0;
        bool same = false;
        FOR_OPEN(i, 0, N)
        {
            int v;
            cin >> v;
            if (v == X)
                same = true;
            m = max(m, v);
        }
        if (same)
        {
            cout << 1 << endl;
        }
        else
        {
            int a = (X / m - 1) * m;
            if(a < 0) a = 0;
            int d = (X - a) % m == 0 ? 1 : 2;
            cout << (a / m) + d << endl;
        }
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define FOR_OPEN(NAME, A, B) for (int NAME = A; NAME < B; ++NAME)
#define FOR_CLOSE(NAME, A, B) for (int NAME = A; NAME <= B; ++NAME)
#define endl '\n'
using ll = long long;

/*

*/
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);

    int T;
    cin >> T;
    while(T--)
    {
        int N, X;
        cin >> N >> X;
        vector<int> v(N);
        bool same = false;
        bool big = false;
        bool didi = false;
        int didimax = 0;
        int mamam = 0;
        FOR_OPEN(i, 0, N)
        {
            cin >> v[i];
            if(v[i] == X)
            {
                same = true;
            }
            if(X < v[i])
            {
                big = true;
            }
            if(X % v[i] == 0)
            {
                didi = true;
                didimax = max(didimax, v[i]);
            }
            mamam = max(mamam, v[i]);
        }
        if(same)
        {
            cout << 1 << endl;
        }
        else if(big)
        {
            cout << 2 << endl;
        }
        else
        {
            int A = static_cast<int>(X / mamam) / 2 + 2;
            int B = (didi ? X / didimax : 0x7FFFFFFF);
            cout << min(A, B) << endl;
        }

    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define FOR_OPEN(NAME, A, B) for (int NAME = A; NAME < B; ++NAME)
#define FOR_CLOSE(NAME, A, B) for (int NAME = A; NAME <= B; ++NAME)
#define endl '\n'
using ll = long long;

/*

*/
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);

    int T;
    cin >> T;
    while(T--)
    {
        int N, X;
        cin >> N >> X;
        vector<int> v(N);
        bool same = false;
        bool big = false;
        bool didi = false;
        int didimax = 0;
        int mamam = 0;
        FOR_OPEN(i, 0, N)
        {
            cin >> v[i];
            if(v[i] == X)
            {
                same = true;
            }
            if(X < v[i])
            {
                big = true;
            }
            if(X % v[i] == 0)
            {
                didi = true;
                didimax = max(didimax, v[i]);
            }
            mamam = max(mamam, v[i]);
        }
        if(same)
        {
            cout << 1 << endl;
        }
        else if(big)
        {
            cout << 2 << endl;
        }
        else
        {
            int A = static_cast<int>(X / (mamam * 2)) + 1;
            A *= 2;
            int B = (didi ? X / didimax : 0x7FFFFFFF);
            cout << min(A, B) << endl;
        }

    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define FOR_OPEN(NAME, A, B) for (int NAME = A; NAME < B; ++NAME)
#define FOR_CLOSE(NAME, A, B) for (int NAME = A; NAME <= B; ++NAME)
#define endl '\n'
using ll = long long;

/*

*/
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);

    int T;
    cin >> T;
    while(T--)
    {
        int N, X;
        cin >> N >> X;
        vector<int> v(N);
        bool same = false;
        bool big = false;
        bool didi = false;
        int didimax = 0;
        int mamam = 0;
        set<int> vv;
        FOR_OPEN(i, 0, N)
        {
            cin >> v[i];
            if(v[i] == X)
            {
                same = true;
            }
            if(X < v[i])
            {
                big = true;
            }
            if(X % v[i] == 0)
            {
                didi = true;
                didimax = max(didimax, v[i]);
            }
            mamam = max(mamam, v[i]);
            vv.insert(v[i]);
        }
        if(same)
        {
            cout << 1 << endl;
        }
        else if(big)
        {
            cout << 2 << endl;
        }
        else
        {
            int A = static_cast<int>(X / mamam);
            if(vv.find(X % mamam) == vv.end()) A += 2;
            else A += 1;
            int B = (didi ? X / didimax : 0x7FFFFFFF);
            cout << min(A, B) << endl;
        }

    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define FOR_OPEN(NAME, A, B) for (int NAME = A; NAME < B; ++NAME)
#define FOR_CLOSE(NAME, A, B) for (int NAME = A; NAME <= B; ++NAME)
#define endl '\n'
using ll = long long;

/*

*/
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);

    int T;
    cin >> T;
    while(T--)
    {
        int N, X;
        cin >> N >> X;
        vector<int> v(N);
        bool same = false;
        bool big = false;
        bool didi = false;
        int didimax = 0;
        int mamam = 0;
        set<int> vv;
        FOR_OPEN(i, 0, N)
        {
            cin >> v[i];
            if(v[i] == X)
            {
                same = true;
            }
            if(X < v[i])
            {
                big = true;
            }
            if(X % v[i] == 0)
            {
                didi = true;
                didimax = max(didimax, v[i]);
            }
            mamam = max(mamam, v[i]);
            vv.insert(v[i]);
        }
        if(same)
        {
            cout << 1 << endl;
        }
        else if(big)
        {
            cout << 2 << endl;
        }
        else
        {
            int A = static_cast<int>(X / mamam) + 2;
            int B = (didi ? X / didimax : 0x7FFFFFFF);
            cout << min(A, B) << endl;
        }

    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define FOR_OPEN(NAME, A, B) for (int NAME = A; NAME < B; ++NAME)
#define FOR_CLOSE(NAME, A, B) for (int NAME = A; NAME <= B; ++NAME)
#define endl '\n'
using ll = long long;

/*

*/
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);

    int T;
    cin >> T;
    while(T--)
    {
        int N, X;
        cin >> N >> X;
        vector<int> v(N);
        bool same = false;
        bool big = false;
        bool didi = false;
        int didimax = 0;
        int mamam = 0;
        set<int> vv;
        FOR_OPEN(i, 0, N)
        {
            cin >> v[i];
            if(v[i] == X)
            {
                same = true;
            }
            if(X < v[i])
            {
                big = true;
            }
            if(X % v[i] == 0)
            {
                didi = true;
                didimax = max(didimax, v[i]);
            }
            mamam = max(mamam, v[i]);
            vv.insert(v[i]);
        }
        if(same)
        {
            cout << 1 << endl;
        }
        else if(big)
        {
            cout << 2 << endl;
        }
        else
        {
            cout << ceil(static_cast<double>(X) / mamam) << endl;
        }

    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define FOR_OPEN(NAME, A, B) for (int NAME = A; NAME < B; ++NAME)
#define FOR_CLOSE(NAME, A, B) for (int NAME = A; NAME <= B; ++NAME)
#define endl '\n'
using ll = long long;

/*

*/
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);

    int T;
    cin >> T;
    while(T--)
    {
        int N, X;
        cin >> N >> X;
        vector<int> v(N);
        bool same = false;
        bool big = false;
        bool didi = false;
        int didimax = 0;
        int mamam = 0;
        FOR_OPEN(i, 0, N)
        {
            cin >> v[i];
            if(v[i] == X)
            {
                same = true;
            }
            if(X < v[i])
            {
                big = true;
            }
            if(X % v[i] == 0)
            {
                didi = true;
                didimax = max(didimax, v[i]);
            }
            mamam = max(mamam, v[i]);
        }
        if(same)
        {
            cout << 1 << endl;
        }
        else if(big)
        {
            cout << 2 << endl;
        }
        else
        {
            int A = static_cast<int>(X / (mamam * 2)) + 2;
            int B = (didi ? X / didimax : 0x7FFFFFFF);
            cout << min(A, B) << endl;
        }

    }

    return 0;
}


#include <iostream>
#include <algorithm>
#include<vector>
typedef unsigned int uint;
typedef unsigned long int luint;
using namespace std;
class TestCases{
	public:
		luint numOfFavNums;
		luint distance;
		luint *favNums;
		long int bandera;
		uint combinations;
		friend class Rabbit;
		luint calcComb();
		void printComb();
		long int binarySearch(luint arr[], uint l, uint r, uint x);
		TestCases();
};

long int TestCases::binarySearch(luint arr[], uint l, uint r, uint x) {
    while (l <= r) {
        int m = l + (r - l) / 2;
        if (arr[m] == x)
            return m;
        if (arr[m] < x)
            l = m + 1;
        else
            r = m - 1;
    }
    return -1;
}

TestCases::TestCases(){
	combinations=0;
	cin>>numOfFavNums>>distance;
	favNums= new luint[numOfFavNums];
	for(uint i=0;i<numOfFavNums;i++){
		cin>>favNums[i];
	}
}

void TestCases::printComb(){
	combinations=calcComb();
	cout<<combinations<<endl;
	delete [] favNums;
}
/*
luint TestCases::calcComb(){
	if(numOfFavNums>1){
		sort(favNums,favNums+numOfFavNums);
		bandera=binarySearch(favNums,0,numOfFavNums-1, distance);
		//cout<<"Distance= "<<distance<< " bandera "<<bandera<<endl;
	}
	else {
		if(favNums[0]==distance)
			bandera=1;
    }
	if(bandera!=-1)
		return 1;
	else{
		if(favNums[numOfFavNums-1]>=(distance/2)){
		//	cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
			return 2;
		}
		else{
			if((distance%favNums[numOfFavNums-1])==0){
			//cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
			  return distance/favNums[numOfFavNums-1];
		    }
			else{
			//	cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
			  return 1+distance/favNums[numOfFavNums-1];
		       }
	   }
	}

}
*/
luint TestCases::calcComb(){
	uint nuevaBand;
	bandera=1000000000;
	sort(favNums,favNums+numOfFavNums);
	for(long int i=numOfFavNums-1;-1<=i;i--){
		if(distance==favNums[i])
			return 1;
		if(favNums[i]>=(distance/2))
			nuevaBand=2;
		else{
			if((distance%favNums[i])==0)
				nuevaBand=distance/favNums[i];
			else
				nuevaBand=distance/favNums[i]+1;
		}
		if(nuevaBand<bandera)
			bandera=nuevaBand;
	}
	return bandera;

}

class Rabbit{
	public:
		uint numTCases;
		Rabbit();
		Rabbit(uint);
		void operator=  (const Rabbit&);
};

Rabbit::Rabbit()
	:numTCases(0){}

void Rabbit::operator=(const Rabbit&right){
	numTCases=right.numTCases;
}
Rabbit::Rabbit(uint testCases){
	//For each test case
	numTCases=testCases;

	//array=new    TestCases[numTCases];
	vector<TestCases*>array(numTCases);
	for(uint i=0;i<numTCases; i++){
		array[i]= new TestCases();
	}
	for(uint i=0;i<numTCases; i++){
		array[i]->printComb();
	}
	array.clear();
}

int main(int argc, char* argv[]) {
	Rabbit bugsBunny;
	uint T;
	cin>>T;	//First Line should read Test Cases
	bugsBunny=Rabbit(T);
	return 0;
}


#include <iostream>
#include <algorithm>
#include<vector>
typedef unsigned int uint;
typedef unsigned long int luint;
using namespace std;
class TestCases{
	public:
		luint numOfFavNums;
		luint distance;
		luint *favNums;
		long int bandera;
		uint combinations;
		friend class Rabbit;
		luint calcComb();
		void printComb();
		long int binarySearch(luint arr[], uint l, uint r, uint x);
		TestCases();
};

long int TestCases::binarySearch(luint arr[], uint l, uint r, uint x) {
    while (l <= r) {
        int m = l + (r - l) / 2;
        if (arr[m] == x)
            return m;
        if (arr[m] < x)
            l = m + 1;
        else
            r = m - 1;
    }
    return -1;
}

TestCases::TestCases(){
	combinations=0;
	cin>>numOfFavNums>>distance;
	favNums= new luint[numOfFavNums];
	for(uint i=0;i<numOfFavNums;i++){
		cin>>favNums[i];
	}
}

void TestCases::printComb(){
	combinations=calcComb();
	cout<<combinations<<endl;
	delete [] favNums;

}
/*
luint TestCases::calcComb(){
	if(numOfFavNums>1){
		sort(favNums,favNums+numOfFavNums);
		bandera=binarySearch(favNums,0,numOfFavNums-1, distance);
		//cout<<"Distance= "<<distance<< " bandera "<<bandera<<endl;
	}
	else {
		if(favNums[0]==distance)
			bandera=1;
    }
	if(bandera!=-1)
		return 1;
	else{
		if(favNums[numOfFavNums-1]>=(distance/2)){
		//	cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
			return 2;
		}
		else{
			if((distance%favNums[numOfFavNums-1])==0){
			//cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
			  return distance/favNums[numOfFavNums-1];
		    }
			else{
			//	cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
			  return 1+distance/favNums[numOfFavNums-1];
		       }
	   }
	}

}
*/
luint TestCases::calcComb(){
	uint nuevaBand;
	bandera=1000000000;
	vector<uint> v (favNums, favNums + sizeof(favNums) / sizeof(uint) );
	sort(v.begin(), v.end());
	for(long int i=v.size()-1;0<=i;i--){
		if(distance==v[i])
			return 1;
		if(v[i]>=(distance/2))
			nuevaBand=2;
		else{
			if((distance%v[i])==0)
				nuevaBand=distance/v[i];
			else
				nuevaBand=distance/v[i]+1;
		}
		if(nuevaBand<bandera)
			bandera=nuevaBand;
	}
	return bandera;

}

class Rabbit{
	public:
		uint numTCases;
		Rabbit();
		Rabbit(uint);
		void operator=  (const Rabbit&);
};

Rabbit::Rabbit()
	:numTCases(0){}

void Rabbit::operator=(const Rabbit&right){
	numTCases=right.numTCases;
}
Rabbit::Rabbit(uint testCases){
	//For each test case
	numTCases=testCases;

	//array=new    TestCases[numTCases];
	vector<TestCases*>array(numTCases);
	for(uint i=0;i<numTCases; i++){
		array[i]= new TestCases();
	}
	for(uint i=0;i<numTCases; i++){
		array[i]->printComb();
	}
	array.clear();
}

int main(int argc, char* argv[]) {
	Rabbit bugsBunny;
	uint T;
	cin>>T;	//First Line should read Test Cases
	bugsBunny=Rabbit(T);
	return 0;
}


#include <iostream>
#include <stdlib.h>
#include <algorithm>
typedef unsigned int uint;
typedef unsigned long int luint;
using namespace std;
class TestCases{
	public:
		uint numOfFavNums;
		luint distance;
		luint *favNums;
		int bandera;
		luint combinations;
		friend class Rabbit;
		luint calcComb();
		void printComb();
		long int binarySearch(luint arr[], uint l, uint r, luint x);
		TestCases();
};

long int TestCases::binarySearch(luint arr[], uint l, uint r, luint x) {
    while (l <= r) {
        int m = l + (r - l) / 2;
        if (arr[m] == x)
            return m;
        if (arr[m] < x)
            l = m + 1;
        else
            r = m - 1;
    }
    return -1;
}

TestCases::TestCases(){
	cin>>numOfFavNums>>distance;
	favNums= new luint[numOfFavNums];
	for(uint i=0;i<numOfFavNums;i++){
		cin>>favNums[i];
	}
	combinations=0;
}

void TestCases::printComb(){
	for(uint i=0;i<numOfFavNums;i++){
		//cout<<"NumNepe["<<i<<"] = "<<favNums[i]<<endl;
	}
	combinations=calcComb();
	delete [] favNums;
	cout<<combinations<<endl;
}

luint TestCases::calcComb(){
	sort(favNums,favNums+sizeof(favNums)/sizeof(favNums[0]));
	bandera=binarySearch(favNums,0, sizeof(favNums)/sizeof(favNums[0])-1, distance);
	//cout<<"Distance= "<<distance<< " bandera "<<bandera<<endl;
	if(bandera!=-1)
		return 1;
	else{
		if(favNums[numOfFavNums-1]>=distance/2){
		//	cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
			return 2;
		}
		if(distance%favNums[numOfFavNums-1]==0){
		//cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
		  return distance%favNums[numOfFavNums-1];
	    }
		if(distance%favNums[numOfFavNums-1]!=0){
		//	cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
		  return distance%favNums[numOfFavNums-1]+1;
	       }
	}

}

class Rabbit{
	public:
		uint numTCases;
		TestCases *array;
		Rabbit();
		Rabbit(uint);
		void operator=  (const Rabbit&);
};

Rabbit::Rabbit()
	:numTCases(0){}

void Rabbit::operator=(const Rabbit&right){
	numTCases=right.numTCases;
}
Rabbit::Rabbit(uint testCases){
	//For each test case
	numTCases=testCases;
	array=new    TestCases[numTCases];
	for(uint i=0;i<numTCases; i++){
		array[i];
	}
	for(uint i=0;i<numTCases; i++){
		array[i].printComb();
	}
	delete [] array;
}

int main(int argc, char* argv[]) {
	Rabbit bugsBunny;
	uint T;
	cin>>T;	//First Line should read Test Cases
	bugsBunny=Rabbit(T);
	return 0;
}


#include <iostream>
#include <algorithm>
#include<vector>
typedef unsigned int uint;
typedef unsigned long int luint;
using namespace std;
class TestCases{
	public:
		luint numOfFavNums;
		luint distance;
		luint *favNums;
		long int bandera;
		uint combinations;
		friend class Rabbit;
		luint calcComb();
		void printComb();
		long int binarySearch(luint arr[], uint l, uint r, uint x);
		TestCases();
};

long int TestCases::binarySearch(luint arr[], uint l, uint r, uint x) {
    while (l <= r) {
        int m = l + (r - l) / 2;
        if (arr[m] == x)
            return m;
        if (arr[m] < x)
            l = m + 1;
        else
            r = m - 1;
    }
    return -1;
}

TestCases::TestCases(){
	combinations=0;
	cin>>numOfFavNums>>distance;
	favNums= new luint[numOfFavNums];
	for(uint i=0;i<numOfFavNums;i++){
		cin>>favNums[i];
	}
}

void TestCases::printComb(){
	combinations=calcComb();
	cout<<combinations<<endl;
	delete [] favNums;
}
/*
luint TestCases::calcComb(){
	if(numOfFavNums>1){
		sort(favNums,favNums+numOfFavNums);
		bandera=binarySearch(favNums,0,numOfFavNums-1, distance);
		//cout<<"Distance= "<<distance<< " bandera "<<bandera<<endl;
	}
	else {
		if(favNums[0]==distance)
			bandera=1;
    }
	if(bandera!=-1)
		return 1;
	else{
		if(favNums[numOfFavNums-1]>=(distance/2)){
		//	cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
			return 2;
		}
		else{
			if((distance%favNums[numOfFavNums-1])==0){
			//cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
			  return distance/favNums[numOfFavNums-1];
		    }
			else{
			//	cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
			  return 1+distance/favNums[numOfFavNums-1];
		       }
	   }
	}

}
*/
luint TestCases::calcComb(){
	uint nuevaBand;
	bandera=1000000000;
	sort(favNums,favNums+numOfFavNums);
	for(int i=numOfFavNums-1;numOfFavNums/2<=i;i--){
		if(distance==favNums[i])
			return 1;
		if(favNums[i]>=(distance/2))
			nuevaBand=2;
		else{
			if((distance%favNums[i])==0)
				nuevaBand=distance/favNums[i];
			else
				nuevaBand=distance/favNums[i]+1;
		}
		if(nuevaBand<bandera)
			bandera=nuevaBand;
	}
	return bandera;

}

class Rabbit{
	public:
		uint numTCases;
		Rabbit();
		Rabbit(uint);
		void operator=  (const Rabbit&);
};

Rabbit::Rabbit()
	:numTCases(0){}

void Rabbit::operator=(const Rabbit&right){
	numTCases=right.numTCases;
}
Rabbit::Rabbit(uint testCases){
	//For each test case
	numTCases=testCases;

	//array=new    TestCases[numTCases];
	vector<TestCases*>array(numTCases);
	for(uint i=0;i<numTCases; i++){
		array[i]= new TestCases();
	}
	for(uint i=0;i<numTCases; i++){
		array[i]->printComb();
	}
	array.clear();
}

int main(int argc, char* argv[]) {
	Rabbit bugsBunny;
	uint T;
	cin>>T;	//First Line should read Test Cases
	bugsBunny=Rabbit(T);
	return 0;
}


#include <iostream>
#include <stdlib.h>
#include <algorithm>
typedef unsigned int uint;
typedef unsigned long int luint;
using namespace std;
class TestCases{
	public:
		uint numOfFavNums;
		uint distance;
		uint *favNums;
		int bandera;
		luint combinations;
		friend class Rabbit;
		luint calcComb();
		void printComb();
		long int binarySearch(uint arr[], uint l, uint r, luint x);
		TestCases();
};

long int TestCases::binarySearch(uint arr[], uint l, uint r, luint x) {
    while (l <= r) {
        int m = l + (r - l) / 2;
        if (arr[m] == x)
            return m;
        if (arr[m] < x)
            l = m + 1;
        else
            r = m - 1;
    }
    return -1;
}

TestCases::TestCases(){
	cin>>numOfFavNums>>distance;
	favNums= new uint[numOfFavNums];
	for(uint i=0;i<numOfFavNums;i++){
		cin>>favNums[i];
	}
	combinations=0;
}

void TestCases::printComb(){
	combinations=calcComb();
	delete [] favNums;
	cout<<combinations<<endl;
}

luint TestCases::calcComb(){
	sort(favNums,favNums+sizeof(favNums)/sizeof(favNums[0]));
	bandera=binarySearch(favNums,0, sizeof(favNums)/sizeof(favNums[0])-1, distance);
	//cout<<"Distance= "<<distance<< " bandera "<<bandera<<endl;
	if(bandera!=-1)
		return 1;
	else{
		if(favNums[numOfFavNums-1]>=distance/2){
		//	cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
			return 2;
		}
		if(distance%favNums[numOfFavNums-1]==0){
		//cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
		  return distance%favNums[numOfFavNums-1];
	    }
		if(distance%favNums[numOfFavNums-1]!=0){
		//	cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
		  return distance%favNums[numOfFavNums-1]+1;
	       }
	}

}

class Rabbit{
	public:
		uint numTCases;
		TestCases *array;
		Rabbit();
		Rabbit(uint);
		void operator=  (const Rabbit&);
};

Rabbit::Rabbit()
	:numTCases(0){}

void Rabbit::operator=(const Rabbit&right){
	numTCases=right.numTCases;
}
Rabbit::Rabbit(uint testCases){
	//For each test case
	numTCases=testCases;
	array=new    TestCases[numTCases];
	for(uint i=0;i<numTCases; i++){
		array[i];
	}
	for(uint i=0;i<numTCases; i++){
		array[i].printComb();
	}
	delete [] array;
}

int main(int argc, char* argv[]) {
	Rabbit bugsBunny;
	uint T;
	cin>>T;	//First Line should read Test Cases
	bugsBunny=Rabbit(T);
	return 0;
}


#include <iostream>
#include <algorithm>
#include<vector>
typedef unsigned int uint;
typedef unsigned long int luint;
using namespace std;
class TestCases{
	public:
		luint numOfFavNums;
		luint distance;
		luint *favNums;
		long int bandera;
		uint combinations;
		friend class Rabbit;
		luint calcComb();
		void printComb();
		long int binarySearch(luint arr[], uint l, uint r, uint x);
		TestCases();
};

long int TestCases::binarySearch(luint arr[], uint l, uint r, uint x) {
    while (l <= r) {
        int m = l + (r - l) / 2;
        if (arr[m] == x)
            return m;
        if (arr[m] < x)
            l = m + 1;
        else
            r = m - 1;
    }
    return -1;
}

TestCases::TestCases(){
	combinations=0;
	cin>>numOfFavNums>>distance;
	favNums= new luint[numOfFavNums];
	for(uint i=0;i<numOfFavNums;i++){
		cin>>favNums[i];
	}
}

void TestCases::printComb(){
	combinations=calcComb();
	cout<<combinations<<endl;
	delete [] favNums;
}
/*
luint TestCases::calcComb(){
	if(numOfFavNums>1){
		sort(favNums,favNums+numOfFavNums);
		bandera=binarySearch(favNums,0,numOfFavNums-1, distance);
		//cout<<"Distance= "<<distance<< " bandera "<<bandera<<endl;
	}
	else {
		if(favNums[0]==distance)
			bandera=1;
    }
	if(bandera!=-1)
		return 1;
	else{
		if(favNums[numOfFavNums-1]>=(distance/2)){
		//	cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
			return 2;
		}
		else{
			if((distance%favNums[numOfFavNums-1])==0){
			//cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
			  return distance/favNums[numOfFavNums-1];
		    }
			else{
			//	cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
			  return 1+distance/favNums[numOfFavNums-1];
		       }
	   }
	}

}
*/
luint TestCases::calcComb(){
	uint nuevaBand;
	bandera=1000000000;
	/*vector<uint> v (favNums, favNums + sizeof(favNums) / sizeof(uint) );
	//sort(v.begin(), v.end());
	for(long int i=v.size()-1;0<=i;i--){
		if(distance==v[i])
			return 1;
		if(v[i]>=(distance/2))
			nuevaBand=2;
		else{
			if((distance%v[i])==0)
				nuevaBand=distance/v[i];
			else
				nuevaBand=distance/v[i]+1;
		}
		if(nuevaBand<bandera)
			bandera=nuevaBand;
	}
	return bandera;
	*/
	for(int i=numOfFavNums-1;-1<i;i--){
		if(distance==favNums[i])
			return 1;
		if(favNums[i]>=(distance/2))
			nuevaBand=2;
		else{
			if((distance%favNums[i])==0)
				nuevaBand=distance/favNums[i];
			else
				nuevaBand=distance/favNums[i]+1;
		}
		if(nuevaBand<bandera)
			bandera=nuevaBand;
	}
	return bandera;

}

class Rabbit{
	public:
		uint numTCases;
		Rabbit();
		Rabbit(uint);
		void operator=  (const Rabbit&);
};

Rabbit::Rabbit()
	:numTCases(0){}

void Rabbit::operator=(const Rabbit&right){
	numTCases=right.numTCases;
}
Rabbit::Rabbit(uint testCases){
	//For each test case
	numTCases=testCases;

	//array=new    TestCases[numTCases];
	vector<TestCases*>array(numTCases);
	for(uint i=0;i<numTCases; i++){
		array[i]= new TestCases();
	}
	for(uint i=0;i<numTCases; i++){
		array[i]->printComb();
	}
	array.clear();
}

int main(int argc, char* argv[]) {
	Rabbit bugsBunny;
	uint T;
	cin>>T;	//First Line should read Test Cases
	bugsBunny=Rabbit(T);
	return 0;
}


#include <iostream>
#include <stdlib.h>
#include <algorithm>
typedef unsigned int uint;
typedef unsigned long int luint;
using namespace std;
class TestCases{
	public:
		luint numOfFavNums;
		uint distance;
		luint *favNums;
		long int bandera;
		luint combinations;
		friend class Rabbit;
		luint calcComb();
		void printComb();
		long int binarySearch(luint arr[], uint l, uint r, luint x);
		TestCases();
};

long int TestCases::binarySearch(luint arr[], uint l, uint r, luint x) {
    while (l <= r) {
        int m = l + (r - l) / 2;
        if (arr[m] == x)
            return m;
        if (arr[m] < x)
            l = m + 1;
        else
            r = m - 1;
    }
    return -1;
}

TestCases::TestCases(){
	cin>>numOfFavNums>>distance;
	favNums= new luint[numOfFavNums];
	for(uint i=0;i<numOfFavNums;i++){
		cin>>favNums[i];
	}
	combinations=0;
}

void TestCases::printComb(){
	combinations=calcComb();
	delete [] favNums;
	cout<<combinations<<endl;
}

luint TestCases::calcComb(){
	sort(favNums,favNums+sizeof(favNums)/sizeof(favNums[0]));
	bandera=binarySearch(favNums,0, sizeof(favNums)/sizeof(favNums[0])-1, distance);
	//cout<<"Distance= "<<distance<< " bandera "<<bandera<<endl;
	if(bandera!=-1)
		return 1;
	else{
		if(favNums[numOfFavNums-1]>=distance/2){
		//	cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
			return 2;
		}
		if(distance%favNums[numOfFavNums-1]==0){
		//cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
		  return distance%favNums[numOfFavNums-1];
	    }
		if(distance%favNums[numOfFavNums-1]!=0){
		//	cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
		  return distance%favNums[numOfFavNums-1]+1;
	       }
	}

}

class Rabbit{
	public:
		uint numTCases;
		TestCases *array;
		Rabbit();
		Rabbit(uint);
		void operator=  (const Rabbit&);
};

Rabbit::Rabbit()
	:numTCases(0){}

void Rabbit::operator=(const Rabbit&right){
	numTCases=right.numTCases;
}
Rabbit::Rabbit(uint testCases){
	//For each test case
	numTCases=testCases;
	array=new    TestCases[numTCases];
	for(uint i=0;i<numTCases; i++){
		array[i];
	}
	for(uint i=0;i<numTCases; i++){
		array[i].printComb();
	}
	delete [] array;
}

int main(int argc, char* argv[]) {
	Rabbit bugsBunny;
	uint T;
	cin>>T;	//First Line should read Test Cases
	bugsBunny=Rabbit(T);
	return 0;
}


#include <iostream>
#include <stdlib.h>
#include <algorithm>
typedef unsigned int uint;
typedef unsigned long int luint;
using namespace std;
class TestCases{
	public:
		uint numOfFavNums;
		uint distance;
		uint *favNums;
		int bandera;
		luint combinations;
		friend class Rabbit;
		luint calcComb();
		void printComb();
		long int binarySearch(uint arr[], uint l, uint r, luint x);
		TestCases();
};

long int TestCases::binarySearch(uint arr[], uint l, uint r, luint x) {
    while (l <= r) {
        int m = l + (r - l) / 2;
        if (arr[m] == x)
            return m;
        if (arr[m] < x)
            l = m + 1;
        else
            r = m - 1;
    }
    return -1;
}

TestCases::TestCases(){
	cin>>numOfFavNums>>distance;
	favNums= new uint[numOfFavNums];
	for(uint i=0;i<numOfFavNums;i++){
		cin>>favNums[i];
	}
	combinations=0;
}

void TestCases::printComb(){
	for(uint i=0;i<numOfFavNums;i++){
		//cout<<"NumNepe["<<i<<"] = "<<favNums[i]<<endl;
	}
	combinations=calcComb();
	delete [] favNums;
	cout<<combinations<<endl;
}

luint TestCases::calcComb(){
	sort(favNums,favNums+sizeof(favNums)/sizeof(favNums[0]));
	bandera=binarySearch(favNums,0, sizeof(favNums)/sizeof(favNums[0])-1, distance);
	//cout<<"Distance= "<<distance<< " bandera "<<bandera<<endl;
	if(bandera!=-1)
		return 1;
	else{
		if(favNums[numOfFavNums-1]>=distance/2){
		//	cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
			return 2;
		}
		if(distance%favNums[numOfFavNums-1]==0){
		//cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
		  return distance%favNums[numOfFavNums-1];
	    }
		if(distance%favNums[numOfFavNums-1]!=0){
		//	cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
		  return distance%favNums[numOfFavNums-1]+1;
	       }
	}

}

class Rabbit{
	public:
		uint numTCases;
		TestCases *array;
		Rabbit();
		Rabbit(uint);
		void operator=  (const Rabbit&);
};

Rabbit::Rabbit()
	:numTCases(0){}

void Rabbit::operator=(const Rabbit&right){
	numTCases=right.numTCases;
}
Rabbit::Rabbit(uint testCases){
	//For each test case
	numTCases=testCases;
	array=new    TestCases[numTCases];
	for(uint i=0;i<numTCases; i++){
		array[i];
	}
	for(uint i=0;i<numTCases; i++){
		array[i].printComb();
	}
	delete [] array;
}

int main(int argc, char* argv[]) {
	Rabbit bugsBunny;
	uint T;
	cin>>T;	//First Line should read Test Cases
	bugsBunny=Rabbit(T);
	return 0;
}


#include <iostream>
#include <algorithm>
#include<vector>
typedef unsigned int uint;
typedef unsigned long int luint;
using namespace std;
class TestCases{
	public:
		luint numOfFavNums;
		luint distance;
		luint *favNums;
		luint bandera;
		uint combinations;
		friend class Rabbit;
		luint calcComb();
		void printComb();
		long int binarySearch(luint arr[], uint l, uint r, uint x);
		TestCases();
};

long int TestCases::binarySearch(luint arr[], uint l, uint r, uint x) {
    while (l <= r) {
        int m = l + (r - l) / 2;
        if (arr[m] == x)
            return m;
        if (arr[m] < x)
            l = m + 1;
        else
            r = m - 1;
    }
    return -1;
}

TestCases::TestCases(){
	combinations=0;
	cin>>numOfFavNums>>distance;
	favNums= new luint[numOfFavNums];
	for(luint i=0;i<numOfFavNums;i++){
		cin>>favNums[i];
	}
}

void TestCases::printComb(){
	combinations=calcComb();
	cout<<combinations<<endl;
	delete [] favNums;
}
/*
luint TestCases::calcComb(){
	if(numOfFavNums>1){
		sort(favNums,favNums+numOfFavNums);
		bandera=binarySearch(favNums,0,numOfFavNums-1, distance);
		//cout<<"Distance= "<<distance<< " bandera "<<bandera<<endl;
	}
	else {
		if(favNums[0]==distance)
			bandera=1;
    }
	if(bandera!=-1)
		return 1;
	else{
		if(favNums[numOfFavNums-1]>=(distance/2)){
		//	cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
			return 2;
		}
		else{
			if((distance%favNums[numOfFavNums-1])==0){
			//cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
			  return distance/favNums[numOfFavNums-1];
		    }
			else{
			//	cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
			  return 1+distance/favNums[numOfFavNums-1];
		       }
	   }
	}

}
*/
luint TestCases::calcComb(){
	uint nuevaBand;
	bandera=1000000002;
	/*vector<uint> v (favNums, favNums + sizeof(favNums) / sizeof(uint) );
	//sort(v.begin(), v.end());
	for(long int i=v.size()-1;0<=i;i--){
		if(distance==v[i])
			return 1;
		if(v[i]>=(distance/2))
			nuevaBand=2;
		else{
			if((distance%v[i])==0)
				nuevaBand=distance/v[i];
			else
				nuevaBand=distance/v[i]+1;
		}
		if(nuevaBand<bandera)
			bandera=nuevaBand;
	}
	return bandera;
	*/
	for(luint i=0;i<numOfFavNums;i++){
		if(distance==favNums[i])
			return 1;
		if((float)favNums[i]>=((float)distance/2))
			nuevaBand=2;
		else{
			if((distance%favNums[i])==0)
				nuevaBand=distance/favNums[i];
			else
				nuevaBand=distance/favNums[i]+1;
		}
		if(nuevaBand<=bandera)
			bandera=nuevaBand;
	}
	return bandera;

}

class Rabbit{
	public:
		luint numTCases;
		Rabbit();
		Rabbit(luint);
		void operator=  (const Rabbit&);
};

Rabbit::Rabbit()
	:numTCases(0){}

void Rabbit::operator=(const Rabbit&right){
	numTCases=right.numTCases;
}
Rabbit::Rabbit(luint testCases){
	//For each test case
	numTCases=testCases;
	//array=new    TestCases[numTCases];
	vector<TestCases*>array(numTCases);
	for(luint i=0;i<numTCases; i++){
		array[i]= new TestCases();
	}
	for(luint i=0;i<numTCases; i++){
		array[i]->printComb();
	}
	array.clear();
}

int main(int argc, char* argv[]) {
	Rabbit bugsBunny;
	luint T;
	cin>>T;	//First Line should read Test Cases
	bugsBunny=Rabbit(T);
	return 0;
}


#include <iostream>
#include <algorithm>
#include<vector>
typedef unsigned int uint;
typedef unsigned long int luint;
using namespace std;
class TestCases{
	public:
		uint numOfFavNums;
		uint distance;
		uint *favNums;
		long int bandera;
		uint combinations;
		friend class Rabbit;
		luint calcComb();
		void printComb();
		long int binarySearch(uint arr[], uint l, uint r, uint x);
		TestCases();
};

long int TestCases::binarySearch(uint arr[], uint l, uint r, uint x) {
    while (l <= r) {
        int m = l + (r - l) / 2;
        if (arr[m] == x)
            return m;
        if (arr[m] < x)
            l = m + 1;
        else
            r = m - 1;
    }
    return -1;
}

TestCases::TestCases(){
	combinations=0;
	cin>>numOfFavNums>>distance;
	favNums= new uint[numOfFavNums];
	for(uint i=0;i<numOfFavNums;i++){
		cin>>favNums[i];
	}
}

void TestCases::printComb(){
	combinations=calcComb();
	cout<<combinations<<endl;
	//delete [] favNums;
}

luint TestCases::calcComb(){
	sort(favNums,favNums+sizeof(favNums)/sizeof(favNums[0]));
	bandera=binarySearch(favNums,0,numOfFavNums, distance);
	//cout<<"Distance= "<<distance<< " bandera "<<bandera<<endl;
	if(bandera!=-1)
		return 1;
	else{
		if(favNums[numOfFavNums-1]>=distance/2){
		//	cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
			return 2;
		}
		if((distance%favNums[numOfFavNums-1])==0){
		//cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
		  return distance%favNums[numOfFavNums-1];
	    }
		if((distance%favNums[numOfFavNums-1])!=0){
		//	cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
		  return distance%favNums[numOfFavNums-1]+1;
	       }
	}

}

class Rabbit{
	public:
		uint numTCases;
		Rabbit();
		Rabbit(uint);
		void operator=  (const Rabbit&);
};

Rabbit::Rabbit()
	:numTCases(0){}

void Rabbit::operator=(const Rabbit&right){
	numTCases=right.numTCases;
}
Rabbit::Rabbit(uint testCases){
	//For each test case
	numTCases=testCases;

	//array=new    TestCases[numTCases];
	vector<TestCases*>array(numTCases);
	for(uint i=0;i<numTCases; i++){
		array[i]= new TestCases();
	}
	for(uint i=0;i<numTCases; i++){
		array[i]->printComb();
	}
	array.clear();
}

int main(int argc, char* argv[]) {
	Rabbit bugsBunny;
	uint T;
	cin>>T;	//First Line should read Test Cases
	bugsBunny=Rabbit(T);
	return 0;
}


#include <iostream>
#include <algorithm>
#include<vector>
typedef unsigned int uint;
typedef unsigned long int luint;
using namespace std;
class TestCases{
	public:
		luint numOfFavNums;
		luint distance;
		luint *favNums;
		long int bandera;
		uint combinations;
		friend class Rabbit;
		luint calcComb();
		void printComb();
		long int binarySearch(luint arr[], uint l, uint r, uint x);
		TestCases();
};

long int TestCases::binarySearch(luint arr[], uint l, uint r, uint x) {
    while (l <= r) {
        int m = l + (r - l) / 2;
        if (arr[m] == x)
            return m;
        if (arr[m] < x)
            l = m + 1;
        else
            r = m - 1;
    }
    return -1;
}

TestCases::TestCases(){
	combinations=0;
	cin>>numOfFavNums>>distance;
	favNums= new luint[numOfFavNums];
	for(uint i=0;i<numOfFavNums;i++){
		cin>>favNums[i];
	}
}

void TestCases::printComb(){
	combinations=calcComb();
	cout<<combinations<<endl;
	delete [] favNums;
}
/*
luint TestCases::calcComb(){
	if(numOfFavNums>1){
		sort(favNums,favNums+numOfFavNums);
		bandera=binarySearch(favNums,0,numOfFavNums-1, distance);
		//cout<<"Distance= "<<distance<< " bandera "<<bandera<<endl;
	}
	else {
		if(favNums[0]==distance)
			bandera=1;
    }
	if(bandera!=-1)
		return 1;
	else{
		if(favNums[numOfFavNums-1]>=(distance/2)){
		//	cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
			return 2;
		}
		else{
			if((distance%favNums[numOfFavNums-1])==0){
			//cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
			  return distance/favNums[numOfFavNums-1];
		    }
			else{
			//	cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
			  return 1+distance/favNums[numOfFavNums-1];
		       }
	   }
	}

}
*/
luint TestCases::calcComb(){
	uint nuevaBand;
	bandera=1000000000;
	//sort(favNums,favNums+numOfFavNums);
	for(int i=numOfFavNums-1;-1<i;i--){
		if(distance==favNums[i])
			return 1;
		if(favNums[i]>=(distance/2))
			nuevaBand=2;
		else{
			if((distance%favNums[i])==0)
				nuevaBand=distance/favNums[i];
			else
				nuevaBand=distance/favNums[i]+1;
		}
		if(nuevaBand<bandera)
			bandera=nuevaBand;
	}
	return bandera;

}

class Rabbit{
	public:
		uint numTCases;
		Rabbit();
		Rabbit(uint);
		void operator=  (const Rabbit&);
};

Rabbit::Rabbit()
	:numTCases(0){}

void Rabbit::operator=(const Rabbit&right){
	numTCases=right.numTCases;
}
Rabbit::Rabbit(uint testCases){
	//For each test case
	numTCases=testCases;

	//array=new    TestCases[numTCases];
	vector<TestCases*>array(numTCases);
	for(uint i=0;i<numTCases; i++){
		array[i]= new TestCases();
	}
	for(uint i=0;i<numTCases; i++){
		array[i]->printComb();
	}
	array.clear();
}

int main(int argc, char* argv[]) {
	Rabbit bugsBunny;
	uint T;
	cin>>T;	//First Line should read Test Cases
	bugsBunny=Rabbit(T);
	return 0;
}


#include <iostream>
#include <algorithm>
#include<vector>
typedef unsigned int uint;
typedef unsigned long int luint;
using namespace std;
class TestCases{
	public:
		luint numOfFavNums;
		luint distance;
		luint *favNums;
		luint bandera;
		uint combinations;
		friend class Rabbit;
		luint calcComb();
		void printComb();
		long int binarySearch(luint arr[], uint l, uint r, uint x);
		TestCases();
};

long int TestCases::binarySearch(luint arr[], uint l, uint r, uint x) {
    while (l <= r) {
        int m = l + (r - l) / 2;
        if (arr[m] == x)
            return m;
        if (arr[m] < x)
            l = m + 1;
        else
            r = m - 1;
    }
    return -1;
}

TestCases::TestCases(){
	combinations=0;
	cin>>numOfFavNums>>distance;
	favNums= new luint[numOfFavNums];
	for(uint i=0;i<numOfFavNums;i++){
		cin>>favNums[i];
	}
}

void TestCases::printComb(){
	combinations=calcComb();
	cout<<combinations<<endl;
	delete [] favNums;
}
/*
luint TestCases::calcComb(){
	if(numOfFavNums>1){
		sort(favNums,favNums+numOfFavNums);
		bandera=binarySearch(favNums,0,numOfFavNums-1, distance);
		//cout<<"Distance= "<<distance<< " bandera "<<bandera<<endl;
	}
	else {
		if(favNums[0]==distance)
			bandera=1;
    }
	if(bandera!=-1)
		return 1;
	else{
		if(favNums[numOfFavNums-1]>=(distance/2)){
		//	cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
			return 2;
		}
		else{
			if((distance%favNums[numOfFavNums-1])==0){
			//cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
			  return distance/favNums[numOfFavNums-1];
		    }
			else{
			//	cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
			  return 1+distance/favNums[numOfFavNums-1];
		       }
	   }
	}

}
*/
luint TestCases::calcComb(){
	uint nuevaBand;
	bandera=1000000000;
	/*vector<uint> v (favNums, favNums + sizeof(favNums) / sizeof(uint) );
	//sort(v.begin(), v.end());
	for(long int i=v.size()-1;0<=i;i--){
		if(distance==v[i])
			return 1;
		if(v[i]>=(distance/2))
			nuevaBand=2;
		else{
			if((distance%v[i])==0)
				nuevaBand=distance/v[i];
			else
				nuevaBand=distance/v[i]+1;
		}
		if(nuevaBand<bandera)
			bandera=nuevaBand;
	}
	return bandera;
	*/
	for(luint i=0;i<numOfFavNums;i++){
		if(distance==favNums[i])
			return 1;
		if(favNums[i]>=(distance/2))
			nuevaBand=2;
		else{
			if((distance%favNums[i])==0)
				nuevaBand=distance/favNums[i];
			else
				nuevaBand=distance/favNums[i]+1;
		}
		if(nuevaBand<bandera)
			bandera=nuevaBand;
	}
	return bandera;

}

class Rabbit{
	public:
		luint numTCases;
		Rabbit();
		Rabbit(luint);
		void operator=  (const Rabbit&);
};

Rabbit::Rabbit()
	:numTCases(0){}

void Rabbit::operator=(const Rabbit&right){
	numTCases=right.numTCases;
}
Rabbit::Rabbit(luint testCases){
	//For each test case
	numTCases=testCases;

	//array=new    TestCases[numTCases];
	vector<TestCases*>array(numTCases);
	for(luint i=0;i<numTCases; i++){
		array[i]= new TestCases();
	}
	for(luint i=0;i<numTCases; i++){
		array[i]->printComb();
	}
	array.clear();
}

int main(int argc, char* argv[]) {
	Rabbit bugsBunny;
	luint T;
	cin>>T;	//First Line should read Test Cases
	bugsBunny=Rabbit(T);
	return 0;
}


#include <iostream>
#include <algorithm>
#include<vector>
typedef unsigned int uint;
typedef unsigned long int luint;
using namespace std;
class TestCases{
	public:
		luint numOfFavNums;
		luint distance;
		luint *favNums;
		luint bandera;
		uint combinations;
		friend class Rabbit;
		luint calcComb();
		void printComb();
		long int binarySearch(luint arr[], uint l, uint r, uint x);
		TestCases();
};

long int TestCases::binarySearch(luint arr[], uint l, uint r, uint x) {
    while (l <= r) {
        int m = l + (r - l) / 2;
        if (arr[m] == x)
            return m;
        if (arr[m] < x)
            l = m + 1;
        else
            r = m - 1;
    }
    return -1;
}

TestCases::TestCases(){
	combinations=0;
	cin>>numOfFavNums>>distance;
	favNums= new luint[numOfFavNums];
	for(luint i=0;i<numOfFavNums;i++){
		cin>>favNums[i];
	}
}

void TestCases::printComb(){
	combinations=calcComb();
	cout<<combinations<<endl;
	delete [] favNums;
}
/*
luint TestCases::calcComb(){
	if(numOfFavNums>1){
		sort(favNums,favNums+numOfFavNums);
		bandera=binarySearch(favNums,0,numOfFavNums-1, distance);
		//cout<<"Distance= "<<distance<< " bandera "<<bandera<<endl;
	}
	else {
		if(favNums[0]==distance)
			bandera=1;
    }
	if(bandera!=-1)
		return 1;
	else{
		if(favNums[numOfFavNums-1]>=(distance/2)){
		//	cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
			return 2;
		}
		else{
			if((distance%favNums[numOfFavNums-1])==0){
			//cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
			  return distance/favNums[numOfFavNums-1];
		    }
			else{
			//	cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
			  return 1+distance/favNums[numOfFavNums-1];
		       }
	   }
	}

}
*/
luint TestCases::calcComb(){
	uint nuevaBand;
	bandera=1000000000;
	/*vector<uint> v (favNums, favNums + sizeof(favNums) / sizeof(uint) );
	//sort(v.begin(), v.end());
	for(long int i=v.size()-1;0<=i;i--){
		if(distance==v[i])
			return 1;
		if(v[i]>=(distance/2))
			nuevaBand=2;
		else{
			if((distance%v[i])==0)
				nuevaBand=distance/v[i];
			else
				nuevaBand=distance/v[i]+1;
		}
		if(nuevaBand<bandera)
			bandera=nuevaBand;
	}
	return bandera;
	*/
	for(luint i=0;i<numOfFavNums;i++){
		if(distance==favNums[i])
			return 1;
		if(favNums[i]>=(distance/2))
			nuevaBand=2;
		else{
			if((distance%favNums[i])==0)
				nuevaBand=distance/favNums[i];
			else
				nuevaBand=distance/favNums[i]+1;
		}
		if(nuevaBand<bandera)
			bandera=nuevaBand;
	}
	return bandera;

}

class Rabbit{
	public:
		luint numTCases;
		Rabbit();
		Rabbit(luint);
		void operator=  (const Rabbit&);
};

Rabbit::Rabbit()
	:numTCases(0){}

void Rabbit::operator=(const Rabbit&right){
	numTCases=right.numTCases;
}
Rabbit::Rabbit(luint testCases){
	//For each test case
	numTCases=testCases;

	//array=new    TestCases[numTCases];
	vector<TestCases*>array(numTCases);
	for(luint i=0;i<numTCases; i++){
		array[i]= new TestCases();
	}
	for(luint i=0;i<numTCases; i++){
		array[i]->printComb();
	}
	array.clear();
}

int main(int argc, char* argv[]) {
	Rabbit bugsBunny;
	luint T;
	cin>>T;	//First Line should read Test Cases
	bugsBunny=Rabbit(T);
	return 0;
}