//AUTHOR: RAVAN_2070
//PUNE INSTITUTE OF COMPUTER TECHNOLOGY
/*
        PEOPLE'S LIVES DON'T END WHEN THEY DIE.
        IT ENDS WHEN THEY LOSE FAITH
                                     -ITACHI UCHIHA
*/
#include<bits/stdc++.h>
typedef unsigned long long int ull;
typedef long long int ll;
typedef unsigned long int ul;
typedef long int l;
typedef long double ld;
#define MOD7 1000000007
#define MOD9 1000000009
#define pi 3.1415926535
#define Test_cases ll TC;cin>>TC;while(TC--)
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(), x.rend()
#define sp(x) fixed<<setprecision(x)
using namespace std;
ll BS(vector<ll>& V,ll low,ll high,ll key);
void SieveOfEratosthenes(vector<ll>& V,ll num);
ll gcd(ll a,ll b);
ll lcm(ll a,ll b);
ull modularExponentiation(ull x,ull n,ull M);
void dsp(vector<ll> &V);
void dsp2(vector<pair<ll,ll>>&V);
void dsp3(map<ll,ll>&M);
double fact(double n);
ll nPr(ll n,ll r);
ll nCr(ll n,ll r);
int main()
{
   fastio
   Test_cases
   {
      ll n,x;cin>>n>>x;
      ll i;
      ll cnt=INT64_MAX;
      vector<ll>V(n);
      for(i=0;i<n;i++)
          {
              cin>>V[i];
              if(x%V[i]==0)
                  cnt=min(cnt,(x/V[i]));
          }
          sort(all(V));
      //cout<<cnt<<endl;
      ll mn=INT64_MAX;
      ll mx=INT64_MIN;

      for(i=0;i<n-1;i++)
      {
          mn=min(mn,V[i+1]-V[i]);
      }
      mx=V[0]+V[n-1];

      ll CNT=2;
      if(x>mx)
      {
          while(x-mx>=mx)
          {
              CNT+=2;
              x-=mx;
          }
          if(x<=0)
          {}
          else
              {

                  if(find(all(V),x-mx)==V.end())
                  CNT+=2;
                  else
                  CNT+=1;

              }

        CNT=min(CNT,cnt);
        cout<<CNT<<endl;
      }
      else if(x<mn)
            {
                CNT=2;
                cnt=min(cnt,CNT);
                cout<<cnt<<endl;
            }
            else if(x>=mn&&x<=mx)
            {
                CNT=2;
                cnt=min(CNT,cnt);
                cout<<cnt<<endl;
            }

   }

  return 0;
}
ll BS(vector<ll>& V,ll low,ll high,ll key)
{
    ll mid=(low+high)/2;
    if(low<=high)
    {
        if(key==V[mid])
        {
            return mid;
        }
        else if(key<V[mid])
            {
                return BS(V,low,mid-1,key);
            }
            else
                return BS(V,mid+1,high,key);
    }
        if(low>-1&&high<(ll)V.size())
        {
            if(V[low]<V[high])
                return low;
            else
                return high;

        }
        else
        {
            return mid;
        }
}
void SieveOfEratosthenes(vector<ll>& V,ll num)
{

    bool prime[num+1];
    memset(prime, true, sizeof(prime));

    for (ll p=2; p*p<=num; p++)
    {
            // IF prime[p] IS NOT CHANGED, THEN IT  IS  PRIME
        if (prime[p] == true)
        {

            for (ll i=p*p; i<=num; i += p)
            prime[i] = false;
        }
    }
    for(ll p=2; p<=num; p++)
        if (prime[p])
        V.push_back(p);//STORE ALL PRIME  NUMBERS

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

}
ll lcm(ll a,ll b)
{
    return (a*b)/gcd(a, b);
}
ull modularExponentiation(ull x,ull n,ull M)
{
    ull result=1;
    while(n>0)
    {
        if(n % 2 ==1)
        result=(result * x)%M;
        x=(x*x)%M;
        n=n/2;
    }
        return result;
}
void dsp(vector<ll> &V)
{
    ull j;
    for(j=0;j<V.size();j++)
    {
        cout<<V[j]<<" ";
    }
    cout<<endl;
}
void dsp2(vector<pair<ll,ll>>&V)
{
    ull j;
    for(j=0;j<V.size();j++)
    {
        cout<<V[j].first<<" "<<V[j].second<<" ";
    }
    cout<<endl;
}
void dsp3(map<ll,ll>&M)
{
      map<ll,ll>::iterator it=M.begin();
      while(it!=M.end())
      {
        cout<<it->first<<" "<<it->second<<endl;
        it++;
      }
}
double fact(double n)
{
    double i=1;
    double res=1;

    if(n==0)
        return 1.00;

    while(i<=n)
    {
        res*=i;
        i++;
    }

    return res;
}
ll nPr(ll n,ll r)
{
    return (fact(n)/fact(n-r));
}
ll nCr(ll n,ll r)
{
    return (fact(n)/(fact(r)*fact(n-r)));
}
//map<ll,ll,greater<int> to sort in descending order ,in iterator declaration no greater<int>


//AUTHOR: RAVAN_2070
//PUNE INSTITUTE OF COMPUTER TECHNOLOGY
/*
        PEOPLE'S LIVES DON'T END WHEN THEY DIE.
        IT ENDS WHEN THEY LOSE FAITH
                                     -ITACHI UCHIHA
*/
#include<bits/stdc++.h>
typedef unsigned long long int ull;
typedef long long int ll;
typedef unsigned long int ul;
typedef long int l;
typedef long double ld;
#define MOD7 1000000007
#define MOD9 1000000009
#define pi 3.1415926535
#define Test_cases ll TC;cin>>TC;while(TC--)
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(), x.rend()
#define sp(x) fixed<<setprecision(x)
using namespace std;
ll BS(vector<ll>& V,ll low,ll high,ll key);
void SieveOfEratosthenes(vector<ll>& V,ll num);
ll gcd(ll a,ll b);
ll lcm(ll a,ll b);
ull modularExponentiation(ull x,ull n,ull M);
void dsp(vector<ll> &V);
void dsp2(vector<pair<ll,ll>>&V);
void dsp3(map<ll,ll>&M);
double fact(double n);
ll nPr(ll n,ll r);
ll nCr(ll n,ll r);
int main()
{
   fastio
   Test_cases
   {
      ll n,x;cin>>n>>x;
      ll i;
      ll cnt=INT64_MAX;
      vector<ll>V(n);
      for(i=0;i<n;i++)
          {
              cin>>V[i];
              if(x%V[i]==0)
                  cnt=min(cnt,(x/V[i]));
          }
          sort(all(V));
      //cout<<cnt<<endl;
      ll mn=INT64_MAX;
      ll mx=INT64_MIN;

      for(i=0;i<n-1;i++)
      {
          mn=min(mn,V[i+1]-V[i]);
      }
      mx=V[0]+V[n-1];

      ll CNT=2;
      if(x>mx)
      {
          if(x-mx>=mx)
          {
              ll n=(x-mx)/mx;
              CNT+=2*n;
              x=x-(n*mx);
          }
          if(x<=0)
          {

           }
          else
              {

                  if(find(all(V),x-mx)==V.end())
                  CNT+=2;
                  else
                  CNT+=1;

              }

        CNT=min(CNT,cnt);
        cout<<CNT<<endl;
      }
      else if(x<mn)
            {
                CNT=2;
                cnt=min(cnt,CNT);
                cout<<cnt<<endl;
            }
            else if(x>=mn&&x<=mx)
            {
                CNT=2;
                cnt=min(CNT,cnt);
                cout<<cnt<<endl;
            }

   }

  return 0;
}
ll BS(vector<ll>& V,ll low,ll high,ll key)
{
    ll mid=(low+high)/2;
    if(low<=high)
    {
        if(key==V[mid])
        {
            return mid;
        }
        else if(key<V[mid])
            {
                return BS(V,low,mid-1,key);
            }
            else
                return BS(V,mid+1,high,key);
    }
        if(low>-1&&high<(ll)V.size())
        {
            if(V[low]<V[high])
                return low;
            else
                return high;

        }
        else
        {
            return mid;
        }
}
void SieveOfEratosthenes(vector<ll>& V,ll num)
{

    bool prime[num+1];
    memset(prime, true, sizeof(prime));

    for (ll p=2; p*p<=num; p++)
    {
            // IF prime[p] IS NOT CHANGED, THEN IT  IS  PRIME
        if (prime[p] == true)
        {

            for (ll i=p*p; i<=num; i += p)
            prime[i] = false;
        }
    }
    for(ll p=2; p<=num; p++)
        if (prime[p])
        V.push_back(p);//STORE ALL PRIME  NUMBERS

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

}
ll lcm(ll a,ll b)
{
    return (a*b)/gcd(a, b);
}
ull modularExponentiation(ull x,ull n,ull M)
{
    ull result=1;
    while(n>0)
    {
        if(n % 2 ==1)
        result=(result * x)%M;
        x=(x*x)%M;
        n=n/2;
    }
        return result;
}
void dsp(vector<ll> &V)
{
    ull j;
    for(j=0;j<V.size();j++)
    {
        cout<<V[j]<<" ";
    }
    cout<<endl;
}
void dsp2(vector<pair<ll,ll>>&V)
{
    ull j;
    for(j=0;j<V.size();j++)
    {
        cout<<V[j].first<<" "<<V[j].second<<" ";
    }
    cout<<endl;
}
void dsp3(map<ll,ll>&M)
{
      map<ll,ll>::iterator it=M.begin();
      while(it!=M.end())
      {
        cout<<it->first<<" "<<it->second<<endl;
        it++;
      }
}
double fact(double n)
{
    double i=1;
    double res=1;

    if(n==0)
        return 1.00;

    while(i<=n)
    {
        res*=i;
        i++;
    }

    return res;
}
ll nPr(ll n,ll r)
{
    return (fact(n)/fact(n-r));
}
ll nCr(ll n,ll r)
{
    return (fact(n)/(fact(r)*fact(n-r)));
}
//map<ll,ll,greater<int> to sort in descending order ,in iterator declaration no greater<int>


//AUTHOR: RAVAN_2070
//PUNE INSTITUTE OF COMPUTER TECHNOLOGY
/*
        PEOPLE'S LIVES DON'T END WHEN THEY DIE.
        IT ENDS WHEN THEY LOSE FAITH
                                     -ITACHI UCHIHA
*/
#include<bits/stdc++.h>
typedef unsigned long long int ull;
typedef long long int ll;
typedef unsigned long int ul;
typedef long int l;
typedef long double ld;
#define MOD7 1000000007
#define MOD9 1000000009
#define pi 3.1415926535
#define Test_cases ll TC;cin>>TC;while(TC--)
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(), x.rend()
#define sp(x) fixed<<setprecision(x)
using namespace std;
ll BS(vector<ll>& V,ll low,ll high,ll key);
void SieveOfEratosthenes(vector<ll>& V,ll num);
ll gcd(ll a,ll b);
ll lcm(ll a,ll b);
ull modularExponentiation(ull x,ull n,ull M);
void dsp(vector<ll> &V);
void dsp2(vector<pair<ll,ll>>&V);
void dsp3(map<ll,ll>&M);
double fact(double n);
ll nPr(ll n,ll r);
ll nCr(ll n,ll r);
int main()
{
   fastio
   Test_cases
   {
      ll n,x;cin>>n>>x;
      ll i;
      ll cnt=INT64_MAX;
      vector<ll>V(n);
      for(i=0;i<n;i++)
          {
              cin>>V[i];
              if(x%V[i]==0)
                  cnt=min(cnt,(x/V[i]));
          }
          sort(all(V));
      ll mn=INT64_MAX;
      ll mx=INT64_MIN;

      for(i=0;i<n-1;i++)
      {
          mn=min(mn,V[i+1]-V[i]);
      }
      mx=V[0]+V[n-1];

      ll CNT=2;
      if(x>mx)
      {
          if(x-mx>mx)
          {
              ll n=(x-mx)/mx;
              CNT+=2*n;
              x=x-(n*mx);
          }
          if(x==0)
          {}
          else
          {
              ll R=x-mx;
              ll R1=x-mx;
             if(find(all(V),x-mx)!=V.end())
                 CNT++;
             else if((R>=mn&&R<=mx)||((R1>=mn&&R1<=mx)))
                CNT+=2;
                else
                CNT+=4;

          }

        CNT=min(CNT,cnt);
        cout<<CNT<<endl;
      }
      else if(x<mn)
            {
                CNT=2;
                cnt=min(cnt,CNT);
                cout<<cnt<<endl;
            }
            else if(x>=mn&&x<=mx)
            {
                CNT=2;
                cnt=min(CNT,cnt);
                cout<<cnt<<endl;
            }

   }

  return 0;
}
ll BS(vector<ll>& V,ll low,ll high,ll key)
{
    ll mid=(low+high)/2;
    if(low<=high)
    {
        if(key==V[mid])
        {
            return mid;
        }
        else if(key<V[mid])
            {
                return BS(V,low,mid-1,key);
            }
            else
                return BS(V,mid+1,high,key);
    }
        if(low>-1&&high<(ll)V.size())
        {
            if(V[low]<V[high])
                return low;
            else
                return high;

        }
        else
        {
            return mid;
        }
}
void SieveOfEratosthenes(vector<ll>& V,ll num)
{

    bool prime[num+1];
    memset(prime, true, sizeof(prime));

    for (ll p=2; p*p<=num; p++)
    {
            // IF prime[p] IS NOT CHANGED, THEN IT  IS  PRIME
        if (prime[p] == true)
        {

            for (ll i=p*p; i<=num; i += p)
            prime[i] = false;
        }
    }
    for(ll p=2; p<=num; p++)
        if (prime[p])
        V.push_back(p);//STORE ALL PRIME  NUMBERS

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

}
ll lcm(ll a,ll b)
{
    return (a*b)/gcd(a, b);
}
ull modularExponentiation(ull x,ull n,ull M)
{
    ull result=1;
    while(n>0)
    {
        if(n % 2 ==1)
        result=(result * x)%M;
        x=(x*x)%M;
        n=n/2;
    }
        return result;
}
void dsp(vector<ll> &V)
{
    ull j;
    for(j=0;j<V.size();j++)
    {
        cout<<V[j]<<" ";
    }
    cout<<endl;
}
void dsp2(vector<pair<ll,ll>>&V)
{
    ull j;
    for(j=0;j<V.size();j++)
    {
        cout<<V[j].first<<" "<<V[j].second<<" ";
    }
    cout<<endl;
}
void dsp3(map<ll,ll>&M)
{
      map<ll,ll>::iterator it=M.begin();
      while(it!=M.end())
      {
        cout<<it->first<<" "<<it->second<<endl;
        it++;
      }
}
double fact(double n)
{
    double i=1;
    double res=1;

    if(n==0)
        return 1.00;

    while(i<=n)
    {
        res*=i;
        i++;
    }

    return res;
}
ll nPr(ll n,ll r)
{
    return (fact(n)/fact(n-r));
}
ll nCr(ll n,ll r)
{
    return (fact(n)/(fact(r)*fact(n-r)));
}
//map<ll,ll,greater<int> to sort in descending order ,in iterator declaration no greater<int>


// FFF.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
//#include "pch.h"

#include <algorithm>
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <map>
#include <iterator>
#include <stack>
#define nmax 200000

using namespace std;

int rezolva()
{
    int n, d;
    cin >> n >> d;

    int minn = nmax;

    for (int i = 0; i < n; i++)
    {
        int x, val;
        cin >> x;

        if (x > d) val = 2;
        else if (1.0 * d / x == d / x) val = d / x;
        else val = d / x + 1;

        if (val < minn) minn = val;
    }

    return minn;

    /*sort(v.begin(), v.end());

    if (find(v.begin(), v.end(), d) != v.end()) return 1;
    else if (v[n - 1] > d) return 2;
    else
    {
        int maxx, i = n - 1;

        if (d / v[i] == 1.0 * d / v[i]) return d / v[i];
        else maxx = d / v[i] + 1;

        while (d / v[i] != 1.0 * d / v[i]) i--;

        if (d / v[i] < maxx) return d / v[i];
        else return maxx;
    }*/
}

int main() {

    vector<int> rez;
    int t;
    cin >> t;
    while (t--) rez.push_back(rezolva());

    for (int i = 0; i < rez.size(); i++) cout << rez[i] << '\n';

    return 0;
}


// FFF.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
//#include "pch.h"

#include <algorithm>
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <map>
#include <iterator>
#include <stack>
#define nmax 6969696969

using namespace std;

long long rezolva()
{
    long long n, d;
    cin >> n >> d;

    long long maxx = -1;

    for (int i = 0; i < n; i++)
    {
        long long x;
        cin >> x;
        if (x == d)
        {
            while (i < n - 1)
            {
                i++;
                cin >> x;
            }
            return 1;
        }
        else if (x > maxx) maxx = x;
    }

    if (maxx > d) return 2;
    else return ceil(1.0 * d / maxx);

}

int main() {

    vector<long long> rez;
    int t;
    cin >> t;
    while (t--) rez.push_back(rezolva());

    for (int i = 0; i < rez.size(); i++) cout << rez[i] << '\n';

    return 0;
}


// FFF.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
//#include "pch.h"

#include <algorithm>
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <map>
#include <iterator>
#include <stack>
#define nmax 6969696969

using namespace std;

int rezolva()
{
    int n, d;
    cin >> n >> d;

    int maxx = -1;

    for (int i = 0; i < n; i++)
    {
        int x;
        cin >> x;
        if (x == d) return 1;
        else if (x > maxx) maxx = x;
    }

    if (maxx > d) return 2;
    else return ceil(1.0 * d / maxx);
}

int main() {

    vector<int> rez;
    int t;
    cin >> t;
    while (t--) rez.push_back(rezolva());

    for (int i = 0; i < rez.size(); i++) cout << rez[i] << '\n';

    return 0;
}


// FFF.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
//#include "pch.h"

#include <algorithm>
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <map>
#include <iterator>
#include <stack>
#define nmax 200000

using namespace std;

int rezolva()
{
    int n, d;
    vector<int> v;
    cin >> n >> d;
    for (int i = 0; i < n; i++)
    {
        int x;
        cin >> x;
        v.push_back(x);
    }

    sort(v.begin(), v.end());

    if (find(v.begin(), v.end(), d) != v.end()) return 1;
    else if (v[n - 1] > d) return 2;
    else
    {
        int maxx, i = n - 1;

        if (d / v[i] == 1.0 * d / v[i]) return d / v[i];
        else maxx = d / v[i] + 1;

        while (d / v[i] != 1.0 * d / v[i]) i--;

        if (d / v[i] < maxx) return d / v[i];
        else return maxx;
    }
}

int main() {

    vector<int> rez;
    int t;
    cin >> t;
    while (t--) rez.push_back(rezolva());

    for (int i = 0; i < rez.size(); i++) cout << rez[i] << '\n';

    return 0;
}


// FFF.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
//#include "pch.h"

#include <algorithm>
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <map>
#include <iterator>
#include <stack>
#define nmax 6969696969

using namespace std;

long long rezolva()
{
    long long n, d;
    cin >> n >> d;

    long long maxx = -1;

    for (int i = 0; i < n; i++)
    {
        long long x;
        cin >> x;
        if (x == d) return 1;
        else if (x > maxx) maxx = x;
    }

    if (maxx > d) return 2;
    else return ceil(1.0 * d / maxx);
}

int main() {

    vector<long long> rez;
    int t;
    cin >> t;
    while (t--) rez.push_back(rezolva());

    for (int i = 0; i < rez.size(); i++) cout << rez[i] << '\n';

    return 0;
}


// FFF.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
//#include "pch.h"

#include <algorithm>
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <map>
#include <iterator>
#include <stack>
#define nmax 696969

using namespace std;

int rezolva()
{
    int n, d;
    cin >> n >> d;

    int maxx = -1;

    for (int i = 0; i < n; i++)
    {
        int x;
        cin >> x;
        if (x == d) return 1;
        else if (x > maxx) maxx = x;
    }

    if (maxx > d) return 2;
    else return ceil(1.0 * d / maxx);
}

int main() {

    vector<int> rez;
    int t;
    cin >> t;
    while (t--) rez.push_back(rezolva());

    for (int i = 0; i < rez.size(); i++) cout << rez[i] << '\n';

    return 0;
}


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

int main(){
	int t ; cin >> t ;
	while(t--){
		int n , d; cin >> n ; cin >> d ; vector<int> v ; v.reserve(n) ; int temp ;
		for(int i=0;i<n;i++){cin >> temp; v.push_back(temp) ;}
		sort(v.begin(),v.end()) ;
		if(binary_search(v.begin(),v.end(),d)){cout << 1 << endl ; }
		else{
			if(*(v.end()-1)>d){cout << 2 << endl ;}
			else{ float ans = (float)d/(float) *(v.end()-1) ; cout << (int)ceil(ans) << endl ;}
		}
	}
	return 0 ;
}


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

int main(){
	int t ; cin >> t ;
	while(t--){
		int n, d ; cin >> n ; cin >> d;
		int a[n] ; int sum =0;
		for(int i=0;i<n;i++){cin >> a[i] ;}
		vector<int> vec (a,a+n) ;
		sort(vec.begin(), vec.begin()+n)  ;
	       	int i = 0 ;
		for(;i<n;i++){
			if(sum>=d){break ; }
			sum = sum + a[i] ;
		}
		if(i==1 && sum >d){cout << i+1 << endl ; }
		else{cout << i << endl  ;}
	}
	return 0 ;
}


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

int main(){
	int t ; cin >> t ;
	while(t--){
		int n , d; cin >> n ; cin >> d ; vector<int> v ; v.reserve(n) ; int temp ;
		for(int i=0;i<n;i++){cin >> temp; v.push_back(temp) ;}
		sort(v.begin(),v.end()) ;
		if(binary_search(v.begin(),v.end(),d)){cout << 1 << endl ; }
		else{
			if(*(v.end()-1)>d){cout << 2 << endl ;}
			else{ float ans = (float)d/(float) *(v.end()-1) ; cout << ceil(ans) << endl ;}
		}
	}
	return 0 ;
}


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

void ans(int n, int d){
  vector<int> a ; int temp ; a.reserve(n) ;
  for(int i=0;i<n;i++){cin >> temp; a.push_back(temp);}
  sort(a.begin(),a.end()) ;
  if(binary_search(a.begin(),a.end(),d)){cout << 1 << endl;}
  else{
    int z=0 ;
    for(vector<int>::iterator it =a.end(); it!=a.begin();--it){
      if(d){break;}
      d = d-*it ; z=*it ;
    }
    if(d==1){cout << 2 << endl ;}
    cout << n -z<< endl ;
  }
}

int main(){
	int t ; cin >> t ;
	while(t--){
		int n , d ; cin >> n ; cin >> d;
		ans(n,d) ;
	}
	return 0 ;
}


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

void ans(int n, int d){
  vector<int> a ; int temp ; a.reserve(n) ;
  for(int i=0;i<n;i++){cin >> temp; a.push_back(temp);}
  sort(a.begin(),a.end()) ;
  if(binary_search(a.begin(),a.end(),d)){cout << 1 << endl;}
  else{
    vector<int>::iterator it=a.end() ;
    for(; it!=a.begin();--it){
      if(d){break;}
      d = d-*it ;
    }
    if(d==1){cout << 2 << endl ;}
    cout << n -*it<< endl ;
  }
}

int main(){
	int t ; cin >> t ;
	while(t--){
		int n , d ; cin >> n ; cin >> d;
		ans(n,d) ;
	}
	return 0 ;
}


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

int main(){
	int t ; cin >> t ;
	while(t--){
		int n , d; cin >> n ; cin >> d ; vector<int> v ; v.reserve(n) ; int temp ;
		for(int i=0;i<n;i++){cin >> temp; v.push_back(temp) ;}
		sort(v.begin(),v.end()) ;
		if(binary_search(v.begin(),v.end(),d)){cout << 1 << endl ; }
		else{
			if(*(v.end()-1)>d){cout << 2 << endl ;}
			else{ double ans = (double)d/(double) *(v.end()-1) ; cout << (int)ceil(ans) << endl ;}
		}
	}
	return 0 ;
}


#include<iostream>
#include<cmath>
#include<algorithm>
using namespace std;
const int maxn=1e5+10;
long long a[maxn];
int main()
{
	int t,n,i;
	long long x;
	int flag;
	cin>>t;
	while(t--)
	{
		cin>>n>>x;
		flag=0;
		for(i=0;i<n;i++)
		{
		  cin>>a[i];
		  if(a[i]==x)
		    flag=1;
		}
		if(flag)
		{
		  cout<<"1"<<endl;
		  continue;
	    }
		sort(a,a+n);
		if(a[n-1]>x)
		  cout<<2<<endl;
		else
		{
			 cout<<(x+a[n-1]-1)/a[n-1]<<endl;
		}
	}
	return 0;
}


#include<iostream>
#include<cmath>
#include<algorithm>
using namespace std;
const int maxn=1e5+10;
long long a[maxn];
int main()
{
	int t,n,i;
	long long x;
	int flag;
	cin>>t;
	while(t--)
	{
		cin>>n>>x;
		flag=0;
		for(i=0;i<n;i++)
		{
		  cin>>a[i];
		  if(a[i]==x)
		    flag=1;
		}
		if(flag)
		{
		  cout<<"1"<<endl;
		  continue;
	    }
		sort(a,a+n);
		if(a[n-1]>x)
		  cout<<2<<endl;
		else
		{
			 cout<<(int)ceil((float)x/ (float)a[n-1])<<endl;
		}
	}
	return 0;
}


#include<iostream>
#include<algorithm>
using namespace std;
const int maxn=1e5+10;
long long a[maxn];
int main()
{
	int t,n,i;
	long long x;
	int flag;
	cin>>t;
	while(t--)
	{
		cin>>n>>x;
		flag=0;
		for(i=0;i<n;i++)
		{
		  cin>>a[i];
		  if(a[i]==x)
		    flag=1;
		}
		if(flag)
		{
		  cout<<"1"<<endl;
		  continue;
	    }
		sort(a,a+n);
		if(a[n-1]>x)
		  cout<<2<<endl;
		else
		{
			cout<< (int)ceil((float)x/ (float)a[n-1]);
			cout<<endl;
		}
	}
	return 0;
}


#include<iostream>
#include<cmath>
#include<algorithm>
using namespace std;
const int maxn=1e5+10;
long long a[maxn];
int main()
{
	int t,n,i;
	long long x;
	int flag;
	cin>>t;
	while(t--)
	{
		cin>>n>>x;
		flag=0;
		for(i=0;i<n;i++)
		{
		  cin>>a[i];
		  if(a[i]==x)
		    flag=1;
		}
		if(flag)
		{
		  cout<<"1"<<endl;
		  continue;
	    }
		sort(a,a+n);
		if(a[n-1]>x)
		  cout<<2<<endl;
		else
		{
			 cout<<ceil((float)x/ (float)a[n-1])<<endl;
		}
	}
	return 0;
}


#include<iostream>
#include<cmath>
#include<algorithm>
using namespace std;
const int maxn=1e5+10;
long long a[maxn];
int main()
{
	int t,n,i;
	long long x;
	int flag;
	cin>>t;
	while(t--)
	{
		cin>>n>>x;
		flag=0;
		for(i=0;i<n;i++)
		{
		  cin>>a[i];
		  if(a[i]==x)
		    flag=1;
		}
		if(flag)
		{
		  cout<<"1"<<endl;
		  continue;
	    }
		sort(a,a+n);
		if(a[n-1]>x)
		  cout<<2<<endl;
		else
		{
			cout<< (int)ceil((float)x/ (float)a[n-1]);
			cout<<endl;
		}
	}
	return 0;
}


#include<iostream>
#include<algorithm>
using namespace std;
const int maxn=1e5+10;
long long a[maxn];
int main()
{
	int t,n,i;
	long long x;
	int flag;
	cin>>t;
	while(t--)
	{
		cin>>n>>x;
		flag=0;
		for(i=0;i<n;i++)
		{
		  cin>>a[i];
		  if(a[i]==x)
		    flag=1;
		}
		if(flag)
		{
		  cout<<"1"<<endl;
		  continue;
	    }
		sort(a,a+n);
		if(a[n-1]>x)
		  cout<<2<<endl;
		else
		{
			cout<< (int)ceil((float)x/ (float)a[i-1]);
			cout<<endl;
		}
	}
	return 0;
}


#include<iostream>
#include<cmath>
#include<algorithm>
using namespace std;
const int maxn=1e5+10;
long long a[maxn];
int main()
{
	int t,n,i;
	long long x;
	int flag;
	cin>>t;
	while(t--)
	{
		cin>>n>>x;
		flag=0;
		for(i=0;i<n;i++)
		{
		  cin>>a[i];
		  if(a[i]==x)
		    flag=1;
		}
		if(flag)
		{
		  cout<<"1"<<endl;
		  continue;
	    }
		sort(a,a+n);
		if(a[n-1]>x)
		  cout<<2<<endl;
		else
		{
			if(x%a[n-1]==0)
			  cout<<x/a[n-1]<<endl;
			else
			  cout<<x/a[n-1]+1<<endl;
		}
	}
	return 0;
}


#include<iostream>
#include<cmath>
#include<algorithm>
using namespace std;
const int maxn=1e5+10;
long long a[maxn];
int main()
{
	int t,n,i;
	long long x;
	int flag;
	cin>>t;
	while(t--)
	{
		cin>>n>>x;
		flag=0;
		for(i=0;i<n;i++)
		{
		  cin>>a[i];
		  if(a[i]==x)
		    flag=1;
		}
		if(flag)
		{
		  cout<<"1"<<endl;
		  continue;
	    }
		sort(a,a+n);
		if(a[n-1]>x)
		  cout<<2<<endl;
		else
		{
			cout<< floor((double)x/a[n-1]);
			cout<<endl;
		}
	}
	return 0;
}


#include<iostream>
#include<cmath>
#include<algorithm>
using namespace std;
const int maxn=1e5+10;
long long a[maxn];
int main()
{
	int t,n,i;
	long long x;
	int flag;
	cin>>t;
	while(t--)
	{
		cin>>n>>x;
		flag=0;
		for(i=0;i<n;i++)
		{
		  cin>>a[i];
		  if(a[i]==x)
		    flag=1;
		}
		if(flag)
		{
		  cout<<"1"<<endl;
		  continue;
	    }
		sort(a,a+n);
		if(a[n-1]>x)
		  cout<<2<<endl;
		else
		{
			 cout<<(long long)ceil((float)x/(float)a[n-1])<<endl;
		}
	}
	return 0;
}


#include<bits/stdc++.h>
#define MAXX 100005
#define SIS std::ios::sync_with_stdio(false)
#define ll long long
#define INF 0x3f3f3f3f
using namespace std;
const int MAX =2e5+5;
const int mod=1e9+7;
//const double PI = 3.141592653589793238462643383279;
const double PI=3.1415926535;
const double esp=1e-10;

ll pow_mod(ll a,ll b)
{
    ll res=1;
    while(b>0)
    {
        if(b&1)
        {
            res=res*a%mod;
        }
        a=a*a%mod;
        b>>=1;
    }
    return res%mod;
}
int n,k,m;

int judge(string s1,string s2)
{
    int i=0,j=n-1;
    while(i<n)
    {
       // cout<<111<<endl;
        if(s1[i]!=s2[j])
            return 0;
            i++;j--;
    }
    return 1;
}
/*int check(string s1)
{
    for(int i=1;i<n;i++)
        if(s1[i]!=s1[i-1])
        return 0;
    return 1;
}*/
int a[1000005];
int main(){
    SIS;
   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;

		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<bits/stdc++.h>
#define MAXX 100005
#define SIS std::ios::sync_with_stdio(false)
#define ll long long
#define INF 0x3f3f3f3f
using namespace std;
const int MAX =2e5+5;
const int mod=1e9+7;
//const double PI = 3.141592653589793238462643383279;
const double PI=3.1415926535;
const double esp=1e-10;

ll pow_mod(ll a,ll b)
{
    ll res=1;
    while(b>0)
    {
        if(b&1)
        {
            res=res*a%mod;
        }
        a=a*a%mod;
        b>>=1;
    }
    return res%mod;
}

int a[100005];
int n,d;
void solve()
{
    int ans = INF;
      if(!d%a[n])
        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-= a[n];
			       ans2++;
		       }
			  ans2+= 2;
            cout << min(ans,ans2) << endl;
      }

}
int main(){
   int t;
	cin >> t;
	while (t--) {

		cin >> n >> d;
		for (int i = 1; i <= n; i++)
			cin >> a[i];
		sort(a + 1, a + 1 + n);
		solve();

	}

    return 0;
}


#include<bits/stdc++.h>
#define MAXX 100005
#define SIS std::ios::sync_with_stdio(false)
#define ll long long
#define INF 0x3f3f3f3f
using namespace std;
const int MAX =2e5+5;
const int mod=1e9+7;
//const double PI = 3.141592653589793238462643383279;
const double PI=3.1415926535;
const double esp=1e-10;

ll pow_mod(ll a,ll b)
{
    ll res=1;
    while(b>0)
    {
        if(b&1)
        {
            res=res*a%mod;
        }
        a=a*a%mod;
        b>>=1;
    }
    return res%mod;
}

int a[1000005];
int n,d;
void solve()
{
    int ans = INF;
    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;
    }

}
int main()
{
    SIS;
    int t;
    cin >> t;
    while (t--)
    {
        memset(a,0,sizeof(a));
        cin >> n >> d;
        for (int i = 1; i <= n; i++)
            cin >> a[i];
        sort(a + 1, a + 1 + n);
        solve();

    }

    return 0;
}


#include<bits/stdc++.h>
#define MAXX 100005
#define SIS std::ios::sync_with_stdio(false)
#define ll long long
#define INF 0x3f3f3f3f
using namespace std;
const int MAX =2e5+5;
const int mod=1e9+7;
//const double PI = 3.141592653589793238462643383279;
const double PI=3.1415926535;
const double esp=1e-10;

ll pow_mod(ll a,ll b)
{
    ll res=1;
    while(b>0)
    {
        if(b&1)
        {
            res=res*a%mod;
        }
        a=a*a%mod;
        b>>=1;
    }
    return res%mod;
}
int n,k,m;

int judge(string s1,string s2)
{
    int i=0,j=n-1;
    while(i<n)
    {
       // cout<<111<<endl;
        if(s1[i]!=s2[j])
            return 0;
            i++;j--;
    }
    return 1;
}
/*int check(string s1)
{
    for(int i=1;i<n;i++)
        if(s1[i]!=s1[i-1])
        return 0;
    return 1;
}*/
int a[100005];
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;

		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<bits/stdc++.h>
#define MAXX 100005
#define SIS std::ios::sync_with_stdio(false)
#define ll long long
#define INF 0x3f3f3f3f
using namespace std;
const int MAX =2e5+5;
const int mod=1e9+7;
//const double PI = 3.141592653589793238462643383279;
const double PI=3.1415926535;
const double esp=1e-10;

ll pow_mod(ll a,ll b)
{
    ll res=1;
    while(b>0)
    {
        if(b&1)
        {
            res=res*a%mod;
        }
        a=a*a%mod;
        b>>=1;
    }
    return res%mod;
}
int n,k,m;

int judge(string s1,string s2)
{
    int i=0,j=n-1;
    while(i<n)
    {
       // cout<<111<<endl;
        if(s1[i]!=s2[j])
            return 0;
            i++;j--;
    }
    return 1;
}
/*int check(string s1)
{
    for(int i=1;i<n;i++)
        if(s1[i]!=s1[i-1])
        return 0;
    return 1;
}*/
int a[1000005];
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;

		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<map>
#include<iostream>
#include<algorithm>
#define MAXX 100005
#define SIS std::ios::sync_with_stdio(false)
#define ll long long
#define INF 0x3f3f3f3f
using namespace std;
const int MAX = 2e5 + 5;
const int mod = 1e9 + 7;
//const double PI = 3.141592653589793238462643383279;
const double PI = 3.1415926535;
const double esp = 1e-10;

ll pow_mod(ll a, ll b)
{
    ll res = 1;
    while (b > 0)
    {
        if (b & 1)
        {
            res = res * a % mod;
        }
        a = a * a % mod;
        b >>= 1;
    }
    return res % mod;
}

int a[1000005];
map<int, int> mp;
int main() {
    int t;
    cin >> t;
    while (t--) {
        int n, d;
        mp.clear();
        cin >> n >> d;
        for (int i = 1; i <= n; i++)
        {
            cin >> a[i];
            mp[a[i]] = 1;
        }
        sort(a + 1, a + n + 1);
        if (mp[d]) {
            cout << 1 << endl;
        }
        else
        {
            cout << max(2, (d + a[n] -1)/ a[n]) << endl;
        }

    }

    return 0;
}


#include<bits/stdc++.h>
#define MAXX 100005
#define SIS std::ios::sync_with_stdio(false)
#define ll long long
#define INF 0x3f3f3f3f
using namespace std;
const int MAX =2e5+5;
const int mod=1e9+7;
//const double PI = 3.141592653589793238462643383279;
const double PI=3.1415926535;
const double esp=1e-10;

ll pow_mod(ll a,ll b)
{
    ll res=1;
    while(b>0)
    {
        if(b&1)
        {
            res=res*a%mod;
        }
        a=a*a%mod;
        b>>=1;
    }
    return res%mod;
}
int n,k,m;

int judge(string s1,string s2)
{
    int i=0,j=n-1;
    while(i<n)
    {
       // cout<<111<<endl;
        if(s1[i]!=s2[j])
            return 0;
            i++;j--;
    }
    return 1;
}
/*int check(string s1)
{
    for(int i=1;i<n;i++)
        if(s1[i]!=s1[i-1])
        return 0;
    return 1;
}*/
int a[100005];
int main(){
     SIS;
     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 cnt=0,flag=INF;
        for(int i=n;i>=1;i--)
        {
            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;
}


#include<bits/stdc++.h>
#define MAXX 100005
#define SIS std::ios::sync_with_stdio(false)
#define ll long long
#define INF 0x3f3f3f3f
using namespace std;
const int MAX =2e5+5;
const int mod=1e9+7;
//const double PI = 3.141592653589793238462643383279;
const double PI=3.1415926535;
const double esp=1e-10;

ll pow_mod(ll a,ll b)
{
    ll res=1;
    while(b>0)
    {
        if(b&1)
        {
            res=res*a%mod;
        }
        a=a*a%mod;
        b>>=1;
    }
    return res%mod;
}
int n,k,m;

int judge(string s1,string s2)
{
    int i=0,j=n-1;
    while(i<n)
    {
       // cout<<111<<endl;
        if(s1[i]!=s2[j])
            return 0;
            i++;j--;
    }
    return 1;
}
/*int check(string s1)
{
    for(int i=1;i<n;i++)
        if(s1[i]!=s1[i-1])
        return 0;
    return 1;
}*/
int a[100005];
int main(){
     SIS;
     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 cnt=0,flag=INF;
        int m=d;
        for(int i=n;a[i]>d;i--)
        {
            m=min(m,a[i]-d);
        }
        for(int i=n;i>=1;i--)
        {
            cnt=0;
            if(a[i]<=m)
            {
                //cout<<a[i]<<endl;
                if(m%a[i]==0)
                {
                    cnt+=m/a[i];
                }
                else
                {
                    cnt+=(m/a[i])+1;

                }
                flag=min(cnt,flag);

            }

        }
        cout<<flag<<endl;

     }

    return 0;
}


#include <bits/stdc++.h>
#define ll long long
#define endl '\n'
#define ff first
#define ss second
using namespace std;
ll a[1000000];
const ll inf=1e18;
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    ll t;
    cin>>t;
    ll n,m,k=0, mx=-inf;
    while(t--)
    {
        cin>>n>>m;
        for(ll i=0; i<n; i++)
        {
            cin>>a[i];
            mx=max(mx, a[i]);
            if(a[i]==m)k=1;
        }
        if(k==1)cout<<1<<endl;
        else if(m<mx)cout<<2<<endl;
        else if(m%mx==0)cout<<m/mx<<endl;
        else
        {
            cout<<m/mx+1<<endl;
        }
        mx=-inf;
        k=0;
}
}

///1 2 3 4 5 6 7 8 9 10


#include <bits/stdc++.h>
#define ll long long
#define endl '\n'
#define ff first
#define ss second
using namespace std;
ll a[1000000];
const ll inf=1e18;
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    ll t;
    cin>>t;
    ll n,m,k=0, mx=-inf;
    while(t--)
    {
        cin>>n>>m;
        for(ll i=0; i<n; i++)
        {
            cin>>a[i];
            mx=max(mx, a[i]);
            if(a[i]==m)k=1;
        }
        if(k==1)cout<<1;
        else if(m<mx)cout<<2<<endl;
        else if(m%mx==0)cout<<m/mx<<endl;
        else
        {
            cout<<m/mx+1<<endl;
        }
        mx=-inf;
}
}

///1 2 3 4 5 6 7 8 9 10


#include <bits/stdc++.h>
#define ll long long
#define endl '\n'
#define ff first
#define ss second
using namespace std;
ll a[1000000];
const ll inf=1e18;
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    ll t;
    cin>>t;
    ll n,k,m, mx=-inf;
    while(t--)
    {
        cin>>n>>m;
        for(ll i=0; i<n; i++)
        {
            cin>>a[i];
            mx=max(mx, a[i]);
        }

        int cnt = -1;
    if (m%mx==0&&m<=mx)cnt=m/mx;
    else if(mx > m) cnt = 2;
         else cnt = m / mx + 1;
    if (cnt == -1) while(true);
    else cout << cnt << '\n';
    }
}

///1 2 3 4 5 6 7 8 9 10


#include <bits/stdc++.h>
#define ll long long
#define endl '\n'
#define ff first
#define ss second
using namespace std;
ll a[100000];
const ll inf=1e18;
int main()
{

    //freopen("tetris.in", "r", stdin);
    //freopen("tetris.out", "w", stdout);
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    ll t;
    cin>>t;
    ll n,k,m, mx=-inf;
    while(t--)
    {
        cin>>n>>m;
        for(ll i=0; i<n; i++)
        {
            cin>>a[i];
            mx=max(mx, a[i]);
        }
        if(mx>m)cout<<2;
        else if(m%mx==0)cout<<m/mx<<endl;
        else cout<<m/mx+1<<endl;
        mx=-inf;
    }
}

///1 2 3 4 5 6 7 8 9 10


#include <bits/stdc++.h>
#define ll long long
#define endl '\n'
#define ff first
#define ss second
using namespace std;
ll a[100000];
const ll inf=1e18;
int main()
{

    //freopen("tetris.in", "r", stdin);
    //freopen("tetris.out", "w", stdout);
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    ll t;
    cin>>t;
    ll n,k,m, mx=-inf;
    while(t--)
    {
        cin>>n>>m;
        for(ll i=0; i<n; i++)
        {
            cin>>a[i];
            if(a[i]<=m)mx=max(mx, a[i]);
        }
        if(m%mx==0)cout<<m/mx<<endl;
        else cout<<m/mx+1<<endl;
        mx=-inf;
    }
}

///1 2 3 4 5 6 7 8 9 10


#include <bits/stdc++.h>
#define ll long long
#define endl '\n'
#define ff first
#define ss second
using namespace std;
ll a[100000];
const ll inf=1e18;
int main()
{

    //freopen("tetris.in", "r", stdin);
    //freopen("tetris.out", "w", stdout);
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    ll t;
    cin>>t;
    ll n,k,m, mx=-inf;
    while(t--)
    {
        cin>>n>>m;
        for(ll i=0; i<n; i++)
        {
            cin>>a[i];
            if(a[i]<=m)mx=max(mx, a[i]);
        }
        if(m%mx==0)cout<<m/mx<<endl;
        else cout<<m/mx+1<<endl;
    }
}

///1 2 3 4 5 6 7 8 9 10


#include <bits/stdc++.h>
#define ll long long
#define endl '\n'
#define ff first
#define ss second
using namespace std;
ll a[1000000];
const ll inf=1e18;
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    ll t;
    cin>>t;
    ll n,k,m, mx=-inf;
    while(t--)
    {
        cin>>n>>m;
        for(ll i=0; i<n; i++)
        {
            cin>>a[i];
            mx=max(mx, a[i]);
        }

        if(m%mx==0&&mx<=m)cout<<m/mx<<endl;
        else if(mx>m)cout<<2<<endl;
            else cout<<m/mx+1<<endl;
            mx=-inf;
    }
}

///1 2 3 4 5 6 7 8 9 10


#include <bits/stdc++.h>
#define ll long long
#define endl '\n'
#define ff first
#define ss second
using namespace std;
ll a[10000000];
const ll inf=1e18;
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    ll t;
    cin>>t;
    ll n,m, mx=-inf;
    while(t--)
    {
        cin>>n>>m;
        for(ll i=0; i<n; i++)
        {
            cin>>a[i];
            mx=max(mx, a[i]);
        }
        if(m<mx)cout<<2<<endl;
        else if(m%mx==0)cout<<m/mx<<endl;
        else
        {
            cout<<m/mx+1<<endl;
        }
        mx=-inf;
}
}

///1 2 3 4 5 6 7 8 9 10


#include <bits/stdc++.h>
#define ll long long
#define endl '\n'
#define ff first
#define ss second
using namespace std;
ll a[10000000];
const ll inf=1e18;
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    ll t;
    cin>>t;
    ll n,m,k=0, mx=-inf;
    while(t--)
    {
        cin>>n>>m;
        for(ll i=0; i<n; i++)
        {
            cin>>a[i];
            mx=max(mx, a[i]);
            if(a[i]==m)k=1;
        }
        if(k==1)cout<<1;
        else if(m<mx)cout<<2<<endl;
        else if(m%mx==0)cout<<m/mx<<endl;
        else
        {
            cout<<m/mx+1<<endl;
        }
        mx=-inf;
}
}

///1 2 3 4 5 6 7 8 9 10


/*我是萌新*/
#include<iostream>
#include<cmath>
#include<cstring>
#include<string>
#include<vector>
#include<algorithm>
#include <iomanip>
typedef long long LL;
const int mod = 1000000009;
using namespace std;
int main()
{
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);
    LL t;
    while (cin >> t)
    {
        while (t--)
        {
            LL n, a, x,i,max1=0,ans=mod,y;
            cin >> n >> x;
            for (i = 0; i < n; i++)
            {
                cin >> a;
                if (a > x)
                {
                    ans = 2; continue;
                }
                if (x % a == 0)
                {
                    if (x / a < ans)
                    {
                        ans = x / a; continue;
                    }
                }
                if (2 * a > x)
                {
                    y = x / a*2;
                    ans = min(y, ans);
                }
            }
            cout << ans << '\n';
        }
    }
}


/*��������*/
#include<iostream>
#include<cmath>
#include<cstring>
#include<string>
#include<algorithm>
#include <iomanip>
typedef long long LL;
const int mod = 1000000009;
using namespace std;
int main()
{
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);
    LL t,n,x,aa;
    while (cin >> t)
    {
        while (t--)
        {
            cin >> n >> x;
            LL flag = 0,flag1=0,max1=0,ans=mod;
            for (LL i = 0; i < n; i++)
            {
                cin >> aa;
                max1 = max(max1, aa);
                if (aa == x)
                    flag = 1;
                if (aa > x)
                    flag1 = 1;

            }
            if (flag) { cout << "1\n"; continue; }
            if(flag1) { cout << "2\n"; continue; }

            cout << (x+max1-1)/max1 << '\n';
        }
    }
}


/*我是萌新*/
#include<iostream>
#include<cmath>
#include<cstring>
#include<string>
#include<vector>
#include<algorithm>
#include <iomanip>
typedef long long LL;
const int mod = 1000000009;
using namespace std;
int main()
{
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);
    LL t;
    while (cin >> t)
    {
        while (t--)
        {
            LL n, a, x,i,max1=0,ans=mod,y;
            cin >> n >> x;
            for (i = 0; i < n; i++)
            {
                cin >> a;
                if (a == x)
                    ans = 1;
                if (x % a == 0)
                {
                    ans = min(ans, x / a);
                }
                if (x % a != 0)
                {
                    if (2 * a < x)
                    {
                        y = x / a + 2;
                        ans = min(ans, y);
                    }
                    if (2 * a > x)
                    {
                        y = 2; ans = min(ans, y);
                    }
                }

            }
            cout << ans << '\n';
        }
    }
}


/*我是萌新*/
#include<iostream>
#include<cmath>
#include<cstring>
#include<string>
#include<vector>
#include<algorithm>
#include <iomanip>
typedef long long LL;
const int mod = 1000000009;
using namespace std;
int main()
{
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);
    LL t;
    while (cin >> t)
    {
        while (t--)
        {
            LL n, a, x,i,max1=0,ans=mod,y;
            cin >> n >> x;
            for (i = 0; i < n; i++)
            {
                cin >> a;
                if (a > x)
                {
                    if (ans > 2)
                    {
                        ans = 2;
                        continue;
                    }
                }
                if (x % a == 0)
                {
                    if (x / a < ans)
                    {
                        ans = x / a; continue;
                    }
                }

                y = x / a;
                if (x % a)
                    y++;
                    ans = min(ans, y);

            }
            cout << ans << '\n';
        }
    }
}


/*我是萌新*/
#include<iostream>
#include<cmath>
#include<cstring>
#include<string>
#include<vector>
#include<algorithm>
#include <iomanip>
typedef long long LL;
const int mod = 1000000009;
using namespace std;
int main()
{
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);
    LL t;
    while (cin >> t)
    {
        while (t--)
        {
            LL n, a, x,i,max1=0,ans=mod,y;
            cin >> n >> x;
            for (i = 0; i < n; i++)
            {
                cin >> a;
                if (a > x)
                {
                    if (ans > 2)
                    {
                        ans = 2;
                        continue;
                    }
                }
                if (x % a == 0)
                {
                    if (x / a < ans)
                    {
                        ans = x / a; continue;
                    }
                }
                y = x / a * 2;
                ans = min(ans, y);
            }
            cout << ans << '\n';
        }
    }
}


/*我是萌新*/
#include<iostream>
#include<cmath>
#include<cstring>
#include<string>
#include<algorithm>
#include <iomanip>
typedef long long LL;
const int mod = 1000000009;
using namespace std;
int main()
{
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);
    int t,n,x,aa;
    while (cin >> t)
    {
        while (t--)
        {
            cin >> n >> x;
            int flag = 0,flag1=0,max1=0;
            for (int i = 0; i < n; i++)
            {
                cin >> aa;
                max1 = max(max1, aa);
                if (aa == x)
                    flag = 1;
                if (aa > x)
                    flag1 = 1;
            }
            if (flag) { cout << "1\n"; continue; }
            if(flag1) { cout << "2\n"; continue; }
            cout << ceil(1.0*x/max1) << '\n';
        }
    }
}


#include<bits/stdc++.h>
using namespace std;
int t, n;
typedef long long ll;
ll a[100007], x;

int main(){
    scanf("%d", &t);
    while(t--){
        ll maxn = 0;
        scanf("%d%lld", &n, &x);
        for (int i = 1; i <= n;i++){
            scanf("%lld", &a[i]);
            maxn = max(maxn, a[i]);
        }
        ll mid = (x + 1) / 2;
        if(maxn==x){
            printf("1\n");
        }else if(maxn>=mid){
            printf("2\n");
        }else{
            int l = 0, r = x + 1;
            while(l<r){
                int m = (l + r) / 2;
                int mid = (x + 1 - m) / 2;
                if(maxn>=mid){
                    r = m - 1;
                }else{
                    l = m + 1;
                }
            }

            int m = l;
            int ans = m / maxn;
            if(m%maxn!=0){
                ans++;
            }
            printf("%d\n",ans+2);
        }

    }
}


#include<bits/stdc++.h>
using namespace std;
int t, n;
typedef long long ll;
ll a[100007], x;

int main(){
    scanf("%d", &t);
    while(t--){
        ll maxn = 0;
        scanf("%d%lld", &n, &x);
        for (int i = 1; i <= n;i++){
            scanf("%lld", &a[i]);
            maxn = max(maxn, a[i]);
        }
        ll mid = (x + 1) / 2;
        if(maxn==x){
            printf("1\n");
        }else if(maxn>=mid){
            printf("2\n");
        }else{
            int l = 0, r = x + 1;
            while(l<=r){
                int m = (l + r) / 2;
                int mid = (x + 1 - m) / 2;
                if(maxn>=mid){
                    r = m - 1;
                }else{
                    l = m + 1;
                }
            }

            int m = r;
            int ans = m / maxn;
            if(m%maxn!=0){
                ans++;
            }
            printf("%d\n",ans+2);
        }

    }
}


#include<bits/stdc++.h>
using namespace std;
int t, n;
typedef long long ll;
ll a[100007], x;

int main(){
    scanf("%d", &t);
    while(t--){
        ll maxn = 0;
        scanf("%d%lld", &n, &x);
        for (int i = 1; i <= n;i++){
            scanf("%lld", &a[i]);
            maxn = max(maxn, a[i]);
        }
        ll mid = (x + 1) / 2;
        if(maxn==x){
            printf("1\n");
        }else if(maxn>=mid){
            printf("2\n");
        }else{
            int l = 0, r = x + 1;
            while(l<=r){
                int m = (l + r) / 2;
                int mid = (x + 1 - m) / 2;
                if(maxn>=mid){
                    r = m - 1;
                }else{
                    l = m + 1;
                }
            }

            int m = max(l,r);
            int ans = m / maxn;
            if(m%maxn!=0){
                ans++;
            }
            printf("%d\n",ans+2);
        }

    }
}


#include<bits/stdc++.h>
using namespace std;
int t, n;
typedef long long ll;
ll a[100007], x;

int main(){
    scanf("%d", &t);
    while(t--){
        ll maxn = 0;
        scanf("%d%lld", &n, &x);
        for (int i = 1; i <= n;i++){
            scanf("%lld", &a[i]);
            maxn = max(maxn, a[i]);
        }
        int ans = x / maxn;
        if(x%maxn!=0){
            ans++;
        }
        if(maxn>x){
            printf("2\n");
        }else{
            printf("%d\n", ans);
        }

    }
}


#include<bits/stdc++.h>
using namespace std;
int t, n;
typedef long long ll;
ll a[100007], x;

int main(){
    scanf("%d", &t);
    while(t--){
        ll maxn = 0;
        scanf("%d%lld", &n, &x);
        for (int i = 1; i <= n;i++){
            scanf("%lld", &a[i]);
            maxn = max(maxn, a[i]);
        }
        ll mid = (x + 1) / 2;
        if(maxn==x){
            printf("1\n");
        }else if(maxn>=mid){
            printf("2\n");
        }else{
            ll ex = x-2*maxn;
            int ans = ex / maxn;
            if(ex%maxn!=0){
                ans++;
            }
            printf("%d\n", ans + 2);
        }

    }
}


#include<bits/stdc++.h>
using namespace std;
int t, n;
typedef long long ll;
ll a[100007], x;

int main(){
    scanf("%d", &t);
    while(t--){
        ll maxn = 0;
        scanf("%d%lld", &n, &x);
        int f = 0;
        for (int i = 1; i <= n;i++){
            scanf("%lld", &a[i]);
            if(a[i]==x){
                f = 1;
            }
            maxn = max(maxn, a[i]);
        }
        int ans = x / maxn;
        if(x%maxn!=0){
            ans++;
        }

        if(f){
            printf("1\n");
        }else if(maxn>x){
            printf("2\n");
        }else{
            printf("%d\n", ans);
        }

    }
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>

using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
template <class T> using indexed_set = tree<T, null_type, less<T>, rb_tree_tag,
    tree_order_statistics_node_update>;
const int MOD = 1000000007;
const ll INF = 1e18 + 90;

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

    int t;
    cin >> t;
    while (t--) {
        int n, x;
        cin >> n >> x;
        vector<int> a(n);
        for (int i = 0 ; i < n; i++) {
            cin >> a[i];
        }

        sort(a.begin(), a.end());

        auto it = lower_bound(a.begin(), a.end(), x);
        if (it != a.end() && *it == x) cout << "1\n";
        else {
            int res = (x % a[n-1] == 0 ? x/a[n-1] : x/a[n-1] + 1);
            res = max(2, res);
            cout << res << endl;
        }
    }

}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>

using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
template <class T> using indexed_set = tree<T, null_type, less<T>, rb_tree_tag,
    tree_order_statistics_node_update>;
const int MOD = 1000000007;
const ll INF = 1e18 + 90;

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

    int t;
    cin >> t;
    while (t--) {
        int n, x;
        cin >> n >> x;
        vector<int> a(n);
        for (int i = 0; i <n; i++) {cin >> a[i];}
        sort(a.begin(), a.end());

        ll cnt = 0;
        if (x == 0) {cout << cnt << endl; continue;}
        else {
            if (x == *lower_bound(a.begin(), a.end(), x)) {cout << "1\n"; continue;}
        }
        if (x < a[n-1]) {cout << 2 << endl; continue;}
        cout << ((x % a[n-1] == 0 ? x/a[n-1] : x/a[n-1]+1) << endl;
    }
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>

using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
template <class T> using indexed_set = tree<T, null_type, less<T>, rb_tree_tag,
    tree_order_statistics_node_update>;
const int MOD = 1000000007;
const ll INF = 1e18 + 90;

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

    int t;
    cin >> t;
    while (t--) {
        int n, x;
        cin >> n >> x;
        vector<int> a(n);
        for (int i = 0; i <n; i++) {cin >> a[i];}
        sort(a.begin(), a.end());

        ll cnt = 0;
        if (x > a[n-1]*3) {
            cnt += (x - a[n-1]*3) / a[n-1] * 2 + 1;
            x -= cnt * a[n-1] * 2;
        }
        if (x > a[n-1] * 2) {
            cnt ++;
            x -= a[n-1];
        }
        if (x == 0);
        else {
            if (x == *lower_bound(a.begin(), a.end(), x)) cnt++;
            else cnt+=2;
        }
        cout << cnt << endl;
    }
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>

using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
template <class T> using indexed_set = tree<T, null_type, less<T>, rb_tree_tag,
    tree_order_statistics_node_update>;
const int MOD = 1000000007;
const ll INF = 1e18 + 90;

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

    int t;
    cin >> t;
    while (t--) {
        int n, x;
        cin >> n >> x;
        vector<int> a(n);
        for (int i = 0; i <n; i++) {cin >> a[i];}
        sort(a.begin(), a.end());

        ll cnt = 0;
        if (x > a[n-1]*2) {
            cnt += (x - a[n-1]*2) / a[n-1] * 2 + 1;
            x -= cnt * a[n-1] * 2;
        }
        if (x == 0);
        else {
            if (x == *lower_bound(a.begin(), a.end(), x)) cnt++;
            else cnt+=2;
        }
        cout << cnt << endl;
    }
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>

using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
template <class T> using indexed_set = tree<T, null_type, less<T>, rb_tree_tag,
    tree_order_statistics_node_update>;
const int MOD = 1000000007;
const ll INF = 1e18 + 90;

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

    int t;
    cin >> t;
    while (t--) {
        int n, x;
        cin >> n >> x;
        vector<int> a(n);
        for (int i = 0; i <n; i++) {cin >> a[i];}
        sort(a.begin(), a.end());

        ll cnt = 0;
        while (x >= a[n-1]*2) {
            cnt++;
            x -= a[n-1];
        }
        if (x == 0);
        else {
            if (x == *lower_bound(a.begin(), a.end(), x)) cnt++;
            else cnt+=2;
        }
        cout << cnt << endl;
    }
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>

using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
template <class T> using indexed_set = tree<T, null_type, less<T>, rb_tree_tag,
    tree_order_statistics_node_update>;
const int MOD = 1000000007;
const ll INF = 1e18 + 90;

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

    int t;
    cin >> t;
    while (t--) {
        int n, x;
        cin >> n >> x;
        vector<int> a(n);
        for (int i = 0; i <n; i++) {cin >> a[i];}
        sort(a.begin(), a.end());

        ll cnt = 0;
        if (x == 0) {cout << cnt << endl; continue;}
        else {
            if (x == *lower_bound(a.begin(), a.end(), x)) {cout << "1\n"; continue;}
        }
        if (x < a[n-1]) {cout << 2 << endl; continue;}
        cout << (x % a[n-1] == 0 ? x/a[n-1] : x/a[n-1]+1) << endl;
    }
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>

using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
template <class T> using indexed_set = tree<T, null_type, less<T>, rb_tree_tag,
    tree_order_statistics_node_update>;
const int MOD = 1000000007;
const ll INF = 1e18 + 90;

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

    int t;
    cin >> t;
    while (t--) {
        int n, x;
        cin >> n >> x;
        vector<int> a(n);
        for (int i = 0; i <n; i++) {cin >> a[i];}
        sort(a.begin(), a.end());

        ll cnt = 0;
        if (x == 0) {cout << cnt << endl; continue;}
        else {
            if (x == *lower_bound(a.begin(), a.end(), x)) {cout << "1\n"; continue;}
        }
        if (x < a[n-1]) {cout << 2 << endl; continue;}
        cout << ((x/a[n-1]) % a[n-1] == 0 ? x/a[n-1] : x/a[n-1]+1) << endl;
    }
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>

using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
template <class T> using indexed_set = tree<T, null_type, less<T>, rb_tree_tag,
    tree_order_statistics_node_update>;
const int MOD = 1000000007;
const ll INF = 1e18 + 90;

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

    int t;
    cin >> t;
    while (t--) {
        int n, x;
        cin >> n >> x;
        vector<int> a(n);
        for (int i = 0; i <n; i++) {cin >> a[i];}
        sort(a.begin(), a.end());

        ll cnt = 0;
        while (x >= a[n-1]*2) {
            cnt++;
            x -= a[n-1];
        }

        set<int> s, s2;
        for (int i = 0; i < n; i++) {
            s.insert(a[i]);
            s2.insert(a[i]*2);
        }

        if (x == 0);
        else {
            if (s.count(x)) cnt++;
            else cnt+=2;
        }
        cout << cnt << endl;
    }
}


#include <bits/stdc++.h>

typedef long long ll;

using namespace std;

int main(){
	int t;
	cin >> t;
	for (int i = 0; i < t; i++){
		ll n, d;
		cin >> n >> d;
		ll ma = 0, arr[n];
		for (ll j = 0; j < n; j++){
			cin >> arr[j];
			ma = max(ma , arr[j]);
		}
		ll answ = d / ma;
		if (answ == 0){
			cout << 2 << '\n';
			continue;
		}
		if (d % ma != 0)
			answ += 1;
		cout << answ << '\n';
	}
}


#include <bits/stdc++.h>

typedef long long ll;

using namespace std;

int main(){
	int t;
	cin >> t;
	for (int i = 0; i < t; i++){
		ll n, d;
		cin >> n >> d;
		int ma = 0, arr[n];
		for (int j = 0; j < n; j++){
			cin >> arr[j];
			ma = max(ma , arr[j]);
		}
		int answ = d / ma;
		if (answ == 0){
			cout << 2 << '\n';
			return 0;
		}
		if (d % ma != 0)
			answ += 1;
		cout << answ << '\n';
	}
}


#include <bits/stdc++.h>

typedef long long ll;

using namespace std;

int main(){
	int t;
	cin >> t;
	for (int i = 0; i < t; i++){
		ll n, d;
		bool flag = false;
		cin >> n >> d;
		ll ma = 0, arr[n];
		for (ll j = 0; j < n; j++){
			cin >> arr[j];
			ma = max(ma , arr[j]);
			if (d == arr[j])
				flag = true;
		}
		ll answ = d / ma;
		if (flag && answ == 0){
			cout << 1 << '\n';
			continue;
		}
		if (answ == 0){
			cout << 2 << '\n';
			continue;
		}
		if (d % ma != 0)
			answ += 1;
		cout << answ << '\n';
	}
}


#include <bits/stdc++.h>

typedef long long ll;

using namespace std;

int main(){
	int t;
	cin >> t;
	for (int i = 0; i < t; i++){
		ll n, d;
		cin >> n >> d;
		ll ma = 0, arr[n];
		for (ll j = 0; j < n; j++){
			cin >> arr[j];
			ma = max(ma , arr[j]);
		}
		ll answ = d / ma;
		if (answ == 0){
			cout << 2 << '\n';
			return 0;
		}
		if (d % ma != 0)
			answ += 1;
		cout << answ << '\n';
	}
}


#include <bits/stdc++.h>

typedef long long ll;

using namespace std;

int main(){
	int t;
	cin >> t;
	for (int i = 0; i < t; i++){
		ll n, d;
		bool flag = false;
		cin >> n >> d;
		ll ma = 0, arr[n];
		for (ll j = 0; j < n; j++){
			cin >> arr[j];
			ma = max(ma , arr[j]);
			if (d == arr[j])
				flag = true;
		}
		ll answ = d / ma;
		if (flag && answ == 0){
			cout << 1;
			continue;
		}
		if (answ == 0){
			cout << 2 << '\n';
			continue;
		}
		if (d % ma != 0)
			answ += 1;
		cout << answ << '\n';
	}
}


#include<bits/stdc++.h>

using namespace std;

int main()
{ long int t,n,x,y,i,j ;
    cin >> t ;
    long long a [100000] ;
while(t--   )
{ cin >> n>>x ;

  int max = 0,s=0 ;
  for ( i = 0 ; i<n ;i++ )
  {
      cin >> a[i] ;
      s+= a[i] ;
      if(a[i]>max) max =a[i] ;
  }

  while( (s<x) && (max !=0 ) )
  {
      s+= abs ( max ) ;
      if ( s<x ) n++;

  }
  if ( x==0 ) n=0 ;
 cout << n << endl ;

}
    return 0;
}


#include<bits/stdc++.h>

using namespace std;

int main()
{ long long t,n,x,y,i,j ;
    cin >> t ;
    long long a [100000] ;
while((t--)&& (t<1001)   )
{ cin >> n>>x ;

  int max = 0,s=0 ;
  for ( i = 0 ; i<n ;i++ )
  {
      cin >> a[i] ;
      s+= a[i] ;
      if(a[i]>max) max =a[i] ;
  }

  while( (s<x) && (max !=0 ) )
  {
      s+= abs ( max ) ;
      if ( s<x ) n++;

  }
  if ( x==0 ) n=0 ;
 cout << n << endl ;

}
    return 0;
}


#include<bits/stdc++.h>

using namespace std;

int main()
{ int t,n,x,y,i,j ;
    cin >> t ;
    int a [100] ;
while(t--)
{ cin >> n>>x ;

  int max = 0,s=0 ;
  for ( i = 0 ; i<n ;i++ )
  {
      cin >> a[i] ;
      s+= a[i] ;
      if(a[i]>max) max =a[i] ;
      if (i=100) break;
  }

  while( (s<x) && (max !=0 ) )
  {
      s+= abs ( max ) ;
      if ( s<x ) n++;

  }
  if ( x==0 ) n=0 ;
 cout << n << endl ;

}
    return 0;
}


#include<bits/stdc++.h>

using namespace std;

int main()
{ int t,n,x,y,i,j ;
    cin >> t ;
    int a [100] ;
while(t--)
{ cin >> n>>x ;

  int max = 0,s=0 ;
  for ( i = 0 ; i<n ;i++ )
  {
      cin >> a[i] ;
      s+= a[i] ;
      if(a[i]>max) max =a[i] ;
  }

  while( (s<x) && (max !=0 ) )
  {
      s+= abs ( max ) ;
      if ( s<x ) n++;
      if ( n > 10 ) break;
  }
  if ( x==0 ) n=0 ;
 cout << n << endl ;

}
    return 0;
}


#include<bits/stdc++.h>

using namespace std;

int main()
{ int t,n,x,y,i,j ;
    cin >> t ;
    int a [100] ;
while(t--)
{ cin >> n>>x ;

  int max = 0,s=0 ;
  for ( i = 0 ; i<n ;i++ )
  {
      cin >> a[i] ;
      s+= a[i] ;
      if(a[i]>max) max =a[i] ;
  }

  while( s<x )
  {
      s+= max ;
      if ( s<x ) n++;
  }
 cout << n << endl ;

}
    return 0;
}


#include<bits/stdc++.h>

using namespace std;

int main()
{ int t,n,x,y,i,j ;
    cin >> t ;
    int a [100] ;
while(t--)
{ cin >> n>>x ;

  int max = 0,s=0 ;
  for ( i = 0 ; i<n ;i++ )
  {
      cin >> a[i] ;
      s+= a[i] ;
      if(a[i]>max) max =a[i] ;
  }

  while( s<x && max )
  {
      s+= max ;
      if ( s<x ) n++;
  }
  if ( x==0 ) n=0 ;
 cout << n << endl ;

}
    return 0;
}


#include<bits/stdc++.h>

using namespace std;

int main()
{ int t,n,x,y,i,j ;
    cin >> t ;
    int a [100] ;
while(t--)
{ cin >> n>>x ;

  int max = 0,s=0 ;
  for ( i = 0 ; i<n ;i++ )
  {
      cin >> a[i] ;
      s+= a[i] ;
      if(a[i]>max) max =a[i] ;
  }

  while( (s<x) && (max !=0 ) )
  {
      s+= abs ( max ) ;
      if ( s<x ) n++;
      if ( n > 1000 ) break;
  }
  if ( x==0 ) n=0 ;
 cout << n << endl ;

}
    return 0;
}


#include<bits/stdc++.h>

using namespace std;

int main()
{ int t,n,x,y,i,j ;
    cin >> t ;
    int a [100] ;
while(t--)
{ cin >> n>>x ;

  int max = 0,s=0 ;
  for ( i = 0 ; i<n ;i++ )
  {
      cin >> a[i] ;
      s+= a[i] ;
      if(a[i]>max) max =a[i] ;
  }

  while( (s<x) && (max !=0 ) )
  {
      s+= max ;
      if ( s<x ) n++;
  }
  if ( x==0 ) n=0 ;
 cout << n << endl ;

}
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main(){
	int t,n,x;
	cin>>t;
	while(t--)
        {
		cin>>n>>x;
		int i = pow(2,31) - 1 ;
		int aux =0 ;
		while(n--){
		    int a;
			cin>>a;
            if( (x+a-1)/a > 2 ) aux = (x+a-1)/a ;
            else aux = 2 ;
            if ( i> aux  ) i = aux ;
			if(a==x) i=1;
		}
		cout<<i<<endl;
	}
	return 0;
}


#include<bits/stdc++.h>

using namespace std;

int main()
{ int t,n,x,y,i,j ;
    cin >> t ;
    int a [100] ;
while(t--)
{ cin >> n>>x ;

  int max = 0,s=0 ;
  for ( i = 0 ; i<n ;i++ )
  {
      cin >> a[i] ;
      s+= a[i] ;
      if(a[i]>max) max =a[i] ;
  }

  while( (s<x) && (max !=0 ) )
  {
      s+= abs (max) ;
      if ( s<x ) n++;
  }
  if ( x==0 ) n=0 ;
 cout << n << endl ;

}
    return 0;
}


#include<iostream>
#include<cstdio>
#include<cmath>
#define ll long long
using namespace std;
ll T,n,x;
ll maxx,minax,a;
ll ans,sum;
int main()
{
	scanf("%lld",&T);
	while(T--)
	{
		ans=0x7fffffff;
		maxx=-0x7fffffff;
		scanf("%lld%lld",&n,&x);
		for(int i=1;i<=n;i++){
			scanf("%lld",&a);
			maxx=max(maxx,a);
			if(a==x) ans=1;
		}
		if(maxx>x&&ans>2) ans=2;
		if(maxx<x){
			sum=x/maxx+1;
			if(x%maxx==0) sum--;
			ans=min(ans,sum);
		}
		printf("%lld\n",ans);
	}
	return 0;
}


#include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
int T,n,x;
int maxx,minax,a;
int ans;
int main()
{
	scanf("%d",&T);
	while(T--)
	{
		ans=0x7fffffff;
		scanf("%d%d",&n,&x);
		for(int i=1;i<=n;i++){
			scanf("%d",&a);
			if(a>x) maxx=max(maxx,a);
			if(a<=x) minax=max(minax,a);
		}
		if(maxx) ans=2;
		if(minax) ans=min(ans,(int)ceil(1.0*x/minax));
		printf("%d\n",ans);
	}
	return 0;
}


#include<iostream>
#include<cstdio>
#include<cmath>
#define ll long long
using namespace std;
ll T,n,x;
ll maxx,minax,a;
ll ans,sum;
int main()
{
	scanf("%lld",&T);
	while(T--)
	{
		ans=0x7fffffff;
		scanf("%lld%lld",&n,&x);
		for(int i=1;i<=n;i++){
			scanf("%lld",&a);
			maxx=max(maxx,a);
			if(a==x) ans=1;
		}
		if(maxx>x&&ans>2) ans=2;
		if(maxx<x){
			sum=x/maxx+1;
			if(x%maxx==0) sum--;
			ans=min(ans,sum);
		}
		printf("%lld\n",ans);
	}
	return 0;
}


#include<iostream>
#include<cstdio>
#include<cmath>
#define ll long long
using namespace std;
ll T,n,x;
ll maxx,a;
ll ans,sum;
bool f=0;
int main()
{
	scanf("%lld",&T);
	while(T--)
	{
		ans=0x7fffffff;
		f=0;
		scanf("%lld%lld",&n,&x);
		for(int i=1;i<=n;i++){
			scanf("%lld",&a);
			maxx=max(maxx,a);
			if(a==x){
				f=1;
			}
		}
		if(f) {
			puts("1");
			continue;
		}
		if(maxx>x){
			puts("2");
			continue;
		}
		ans=x/maxx;
		if(x-maxx*ans==0) printf("%lld\n",ans);
		else printf("%lld\n",ans+1);
	}
	return 0;
}


#include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
int T,n,x;
int maxx,minax,a;
int ans;
int main()
{
	scanf("%d",&T);
	while(T--)
	{
		ans=0x7fffffff;
		scanf("%d%d",&n,&x);
		for(int i=1;i<=n;i++){
			scanf("%d",&a);
			if(a>x) maxx=max(maxx,a);
			if(a<=x) minax=max(minax,a);
		}
		if(x==0){
			puts("0");
			continue;
		}
		if(maxx) ans=2;
		if(minax) ans=min(ans,(int)ceil(1.0*x/minax));
		printf("%d\n",ans);
	}
	return 0;
}


#include<bits/stdc++.h>

#define si(a) scanf("%d",&a)
#define sl(a) scanf("%lld",&a)
#define sd(a) scanf("%lf",&a)
#define sc(a) scahf("%c",&a);
#define ss(a) scanf("%s",a)
#define pi(a) printf("%d\n",a)
#define pl(a) printf("%lld\n",a)
#define pc(a) putchar(a)
#define ms(a) memset(a,0,sizeof(a))
#define repi(i, a, b) for(register int i=a;i<=b;++i)
#define repd(i, a, b) for(register int i=a;i>=b;--i)
#define reps(s) for(register int i=head[s];i;i=Next[i])
#define ll long long
#define ull unsigned long long
#define vi vector<int>
#define vc vector<char>
#define pii pair<int,int>
#define pll pair<long,long>
#define pil pair<int,long>
#define pli pair<long,int>
#define mii unordered_map<int,int>
#define msi unordered_map<string,int>
#define lowbit(x) ((x)&(-(x)))
#define ce(i, r) i==r?'\n':' '
#define pb push_back
#define fi first
#define se second
#define INF 0x3f3f3f3f
#define pr(x) cout<<#x<<": "<<x<<endl
using namespace std;

inline int qr() {
    int f = 0, fu = 1;
    char c = getchar();
    while (c < '0' || c > '9') {
        if (c == '-')fu = -1;
        c = getchar();
    }
    while (c >= '0' && c <= '9') {
        f = (f << 3) + (f << 1) + c - 48;
        c = getchar();
    }
    return f * fu;
}

const int N = 1e5 + 10;
int t, n, x, cnt;
int a[N];
vi b;
int main() {
    t = qr();
    while (t--) {
        n = qr(), x = qr();
        repi(i, 1, n)a[i] = qr(),b.pb(a[i]);
        if(count(a+1,a+1+n,x))puts("1");
        else pi(max(2,(int)ceil(x*1.0/(*max_element(a+1,a+1+n)))));
    }
    return 0;
}


#include<bits/stdc++.h>

#define si(a) scanf("%d",&a)
#define sl(a) scanf("%lld",&a)
#define sd(a) scanf("%lf",&a)
#define sc(a) scahf("%c",&a);
#define ss(a) scanf("%s",a)
#define pi(a) printf("%d\n",a)
#define pl(a) printf("%lld\n",a)
#define pc(a) putchar(a)
#define ms(a) memset(a,0,sizeof(a))
#define repi(i, a, b) for(register int i=a;i<=b;++i)
#define repd(i, a, b) for(register int i=a;i>=b;--i)
#define reps(s) for(register int i=head[s];i;i=Next[i])
#define ll long long
#define ull unsigned long long
#define vi vector<int>
#define vc vector<char>
#define pii pair<int,int>
#define pll pair<long,long>
#define pil pair<int,long>
#define pli pair<long,int>
#define mii unordered_map<int,int>
#define msi unordered_map<string,int>
#define lowbit(x) ((x)&(-(x)))
#define ce(i, r) i==r?'\n':' '
#define pb push_back
#define fi first
#define se second
#define INF 0x3f3f3f3f
#define pr(x) cout<<#x<<": "<<x<<endl
using namespace std;

inline int qr() {
    int f = 0, fu = 1;
    char c = getchar();
    while (c < '0' || c > '9') {
        if (c == '-')fu = -1;
        c = getchar();
    }
    while (c >= '0' && c <= '9') {
        f = (f << 3) + (f << 1) + c - 48;
        c = getchar();
    }
    return f * fu;
}

const int N = 1e5 + 10;
int t, n, x, cnt;
int a[N];

int main() {
    t = qr();
    while (t--) {
        n = qr(), x = qr();
        repi(i, 1, n)a[i] = qr();
        bool suc=false;int mx=0;
        repi(i,1,n){
            if(a[i]==x){
                suc=true;
                break;
            }
            mx=max(mx,a[i]);
        }
        if(suc)puts("1");
        else pi(max(2,(int)ceil(x*1.0/mx)));
    }
    return 0;
}


#include<bits/stdc++.h>

#define si(a) scanf("%d",&a)
#define sl(a) scanf("%lld",&a)
#define sd(a) scanf("%lf",&a)
#define sc(a) scahf("%c",&a);
#define ss(a) scanf("%s",a)
#define pi(a) printf("%d\n",a)
#define pl(a) printf("%lld\n",a)
#define pc(a) putchar(a)
#define ms(a) memset(a,0,sizeof(a))
#define repi(i, a, b) for(register int i=a;i<=b;++i)
#define repd(i, a, b) for(register int i=a;i>=b;--i)
#define reps(s) for(register int i=head[s];i;i=Next[i])
#define ll long long
#define ull unsigned long long
#define vi vector<int>
#define vc vector<char>
#define pii pair<int,int>
#define pll pair<long,long>
#define pil pair<int,long>
#define pli pair<long,int>
#define mii unordered_map<int,int>
#define msi unordered_map<string,int>
#define lowbit(x) ((x)&(-(x)))
#define ce(i, r) i==r?'\n':' '
#define pb push_back
#define fi first
#define se second
#define INF 0x3f3f3f3f
#define pr(x) cout<<#x<<": "<<x<<endl
using namespace std;

inline int qr() {
    int f = 0, fu = 1;
    char c = getchar();
    while (c < '0' || c > '9') {
        if (c == '-')fu = -1;
        c = getchar();
    }
    while (c >= '0' && c <= '9') {
        f = (f << 3) + (f << 1) + c - 48;
        c = getchar();
    }
    return f * fu;
}

const int N = 1e5 + 10;
int t, n, x, cnt;
int a[N];

int main() {
    t = qr();
    while (t--) {
        n = qr(), x = qr();
        repi(i, 1, n)a[i] = qr();
        sort(a + 1, a + n + 1, greater<int>());
        if(a[1]>x){
            bool flag=false;
            repi(i,1,n)
                if(a[i]==x){
                    flag=true;
                    break;
                }
            puts(flag ? "1" : "2");
            continue;
        }
        cnt=0;
        int res=N;
        repi(i,1,n){
            int k=x/a[i];
            if(!k)break;
            cnt+=k,x-=a[i]*k;
            if(!x)break;
        }
        if(x)cnt++;
        pi(min(cnt,res));
    }
    return 0;
}


#pragma GCC optimize(2)
#pragma GCC optimize("Ofast")
#pragma GCC optimize("inline")
#pragma GCC optimize("-fgcse")
#pragma GCC optimize("-fgcse-lm")
#pragma GCC optimize("-fipa-sra")
#pragma GCC optimize("-ftree-pre")
#pragma GCC optimize("-ftree-vrp")
#pragma GCC optimize("-fpeephole2")
#pragma GCC optimize("-ffast-math")
#pragma GCC optimize("-fsched-spec")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("-falign-jumps")
#pragma GCC optimize("-falign-loops")
#pragma GCC optimize("-falign-labels")
#pragma GCC optimize("-fdevirtualize")
#pragma GCC optimize("-fcaller-saves")
#pragma GCC optimize("-fcrossjumping")
#pragma GCC optimize("-fthread-jumps")
#pragma GCC optimize("-funroll-loops")
#pragma GCC optimize("-fwhole-program")
#pragma GCC optimize("-freorder-blocks")
#pragma GCC optimize("-fschedule-insns")
#pragma GCC optimize("inline-functions")
#pragma GCC optimize("-ftree-tail-merge")
#pragma GCC optimize("-fschedule-insns2")
#pragma GCC optimize("-fstrict-aliasing")
#pragma GCC optimize("-fstrict-overflow")
#pragma GCC optimize("-falign-functions")
#pragma GCC optimize("-fcse-skip-blocks")
#pragma GCC optimize("-fcse-follow-jumps")
#pragma GCC optimize("-fsched-interblock")
#pragma GCC optimize("-fpartial-inlining")
#pragma GCC optimize("no-stack-protector")
#pragma GCC optimize("-freorder-functions")
#pragma GCC optimize("-findirect-inlining")
#pragma GCC optimize("-fhoist-adjacent-loads")
#pragma GCC optimize("-frerun-cse-after-loop")
#pragma GCC optimize("inline-small-functions")
#pragma GCC optimize("-finline-small-functions")
#pragma GCC optimize("-ftree-switch-conversion")
#pragma GCC optimize("-foptimize-sibling-calls")
#pragma GCC optimize("-fexpensive-optimizations")
#pragma GCC optimize("-funsafe-loop-optimizations")
#pragma GCC optimize("inline-functions-called-once")
#pragma GCC optimize("-fdelete-null-pointer-checks")
#pragma GCC optimize(3)
#include<bits/stdc++.h>

#define si(a) scanf("%d",&a)
#define sl(a) scanf("%lld",&a)
#define sd(a) scanf("%lf",&a)
#define sc(a) scahf("%c",&a);
#define ss(a) scanf("%s",a)
#define pi(a) printf("%d\n",a)
#define pl(a) printf("%lld\n",a)
#define pc(a) putchar(a)
#define ms(a) memset(a,0,sizeof(a))
#define repi(i, a, b) for(register int i=a;i<=b;++i)
#define repd(i, a, b) for(register int i=a;i>=b;--i)
#define reps(s) for(register int i=head[s];i;i=Next[i])
#define ll long long
#define ull unsigned long long
#define vi vector<int>
#define vc vector<char>
#define pii pair<int,int>
#define pll pair<long,long>
#define pil pair<int,long>
#define pli pair<long,int>
#define mii unordered_map<int,int>
#define msi unordered_map<string,int>
#define lowbit(x) ((x)&(-(x)))
#define ce(i, r) i==r?'\n':' '
#define pb push_back
#define fi first
#define se second
#define INF 0x3f3f3f3f
#define pr(x) cout<<#x<<": "<<x<<endl
using namespace std;

inline int qr() {
    int f = 0, fu = 1;
    char c = getchar();
    while (c < '0' || c > '9') {
        if (c == '-')fu = -1;
        c = getchar();
    }
    while (c >= '0' && c <= '9') {
        f = (f << 3) + (f << 1) + c - 48;
        c = getchar();
    }
    return f * fu;
}

const int N = 1e5 + 10;
int t, n, x;
int a[N];

int main() {
    t = qr();
    while (t--) {
        n = qr(), x = qr();
        repi(i, 1, n)a[i] = qr();
        count(a + 1, a + 1 + n, x) ? puts("1") : pi(max(2, (int) ceil(x * 1.0 / (*max_element(a + 1, a + 1 + n)))));
    }
    return 0;
}


#pragma GCC target("avx")
#pragma GCC optimize(2)
#pragma GCC optimize("Ofast")
#pragma GCC optimize("inline")
#pragma GCC optimize("-fgcse")
#pragma GCC optimize("-fgcse-lm")
#pragma GCC optimize("-fipa-sra")
#pragma GCC optimize("-ftree-pre")
#pragma GCC optimize("-ftree-vrp")
#pragma GCC optimize("-fpeephole2")
#pragma GCC optimize("-ffast-math")
#pragma GCC optimize("-fsched-spec")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("-falign-jumps")
#pragma GCC optimize("-falign-loops")
#pragma GCC optimize("-falign-labels")
#pragma GCC optimize("-fdevirtualize")
#pragma GCC optimize("-fcaller-saves")
#pragma GCC optimize("-fcrossjumping")
#pragma GCC optimize("-fthread-jumps")
#pragma GCC optimize("-funroll-loops")
#pragma GCC optimize("-fwhole-program")
#pragma GCC optimize("-freorder-blocks")
#pragma GCC optimize("-fschedule-insns")
#pragma GCC optimize("inline-functions")
#pragma GCC optimize("-ftree-tail-merge")
#pragma GCC optimize("-fschedule-insns2")
#pragma GCC optimize("-fstrict-aliasing")
#pragma GCC optimize("-fstrict-overflow")
#pragma GCC optimize("-falign-functions")
#pragma GCC optimize("-fcse-skip-blocks")
#pragma GCC optimize("-fcse-follow-jumps")
#pragma GCC optimize("-fsched-interblock")
#pragma GCC optimize("-fpartial-inlining")
#pragma GCC optimize("no-stack-protector")
#pragma GCC optimize("-freorder-functions")
#pragma GCC optimize("-findirect-inlining")
#pragma GCC optimize("-fhoist-adjacent-loads")
#pragma GCC optimize("-frerun-cse-after-loop")
#pragma GCC optimize("inline-small-functions")
#pragma GCC optimize("-finline-small-functions")
#pragma GCC optimize("-ftree-switch-conversion")
#pragma GCC optimize("-foptimize-sibling-calls")
#pragma GCC optimize("-fexpensive-optimizations")
#pragma GCC optimize("-funsafe-loop-optimizations")
#pragma GCC optimize("inline-functions-called-once")
#pragma GCC optimize("-fdelete-null-pointer-checks")
#pragma GCC optimize(3)
#include<bits/stdc++.h>

#define si(a) scanf("%d",&a)
#define sl(a) scanf("%lld",&a)
#define sd(a) scanf("%lf",&a)
#define sc(a) scahf("%c",&a);
#define ss(a) scanf("%s",a)
#define pi(a) printf("%d\n",a)
#define pl(a) printf("%lld\n",a)
#define pc(a) putchar(a)
#define ms(a) memset(a,0,sizeof(a))
#define repi(i, a, b) for(register int i=a;i<=b;++i)
#define repd(i, a, b) for(register int i=a;i>=b;--i)
#define reps(s) for(register int i=head[s];i;i=Next[i])
#define ll long long
#define ull unsigned long long
#define vi vector<int>
#define vc vector<char>
#define pii pair<int,int>
#define pll pair<long,long>
#define pil pair<int,long>
#define pli pair<long,int>
#define mii unordered_map<int,int>
#define msi unordered_map<string,int>
#define lowbit(x) ((x)&(-(x)))
#define ce(i, r) i==r?'\n':' '
#define pb push_back
#define fi first
#define se second
#define INF 0x3f3f3f3f
#define pr(x) cout<<#x<<": "<<x<<endl
using namespace std;

inline int qr() {
    int f = 0, fu = 1;
    char c = getchar();
    while (c < '0' || c > '9') {
        if (c == '-')fu = -1;
        c = getchar();
    }
    while (c >= '0' && c <= '9') {
        f = (f << 3) + (f << 1) + c - 48;
        c = getchar();
    }
    return f * fu;
}

const int N = 1e5 + 10;
int t, n, x, cnt;
int a[N];
vi b;
int main() {
    t = qr();
    while (t--) {
        n = qr(), x = qr();
        repi(i, 1, n)a[i] = qr(),b.pb(a[i]);
        if(count(a+1,a+1+n,x))puts("1");
        else pi(max(2,(int)ceil(x*1.0/(*max_element(a+1,a+1+n)))));
    }
    return 0;
}


#include<bits/stdc++.h>

#define si(a) scanf("%d",&a)
#define sl(a) scanf("%lld",&a)
#define sd(a) scanf("%lf",&a)
#define sc(a) scahf("%c",&a);
#define ss(a) scanf("%s",a)
#define pi(a) printf("%d\n",a)
#define pl(a) printf("%lld\n",a)
#define pc(a) putchar(a)
#define ms(a) memset(a,0,sizeof(a))
#define repi(i, a, b) for(register int i=a;i<=b;++i)
#define repd(i, a, b) for(register int i=a;i>=b;--i)
#define reps(s) for(register int i=head[s];i;i=Next[i])
#define ll long long
#define ull unsigned long long
#define vi vector<int>
#define vc vector<char>
#define pii pair<int,int>
#define pll pair<long,long>
#define pil pair<int,long>
#define pli pair<long,int>
#define mii unordered_map<int,int>
#define msi unordered_map<string,int>
#define lowbit(x) ((x)&(-(x)))
#define ce(i, r) i==r?'\n':' '
#define pb push_back
#define fi first
#define se second
#define INF 0x3f3f3f3f
#define pr(x) cout<<#x<<": "<<x<<endl
using namespace std;

inline int qr() {
    int f = 0, fu = 1;
    char c = getchar();
    while (c < '0' || c > '9') {
        if (c == '-')fu = -1;
        c = getchar();
    }
    while (c >= '0' && c <= '9') {
        f = (f << 3) + (f << 1) + c - 48;
        c = getchar();
    }
    return f * fu;
}

const int N = 1e5 + 10;
int t, n, x, cnt;
int a[N];

int main() {
    t = qr();
    while (t--) {
        n = qr(), x = qr();
        repi(i, 1, n)a[i] = qr();
        sort(a + 1, a + n + 1, greater<int>());
        int d = *lower_bound(a + 1, a + 1 + n, x, greater<int>());
        if (d == x)
            puts("1");
        else {
            cnt = 1;
            pii rge = {x - d, x + d};
            while (true) {
                cnt++;
                if (rge.fi <= a[1] && rge.se >= a[n]) {
                    pi(cnt);
                    break;
                }
                if (rge.fi > a[1]) { rge.fi -= a[1], rge.se += a[1]; }
                else if (rge.se < a[n]) { rge.fi -= a[n], rge.se += a[n]; }
            }
        }
    }
    return 0;
}


#include<bits/stdc++.h>

#define si(a) scanf("%d",&a)
#define sl(a) scanf("%lld",&a)
#define sd(a) scanf("%lf",&a)
#define sc(a) scahf("%c",&a);
#define ss(a) scanf("%s",a)
#define pi(a) printf("%d\n",a)
#define pl(a) printf("%lld\n",a)
#define pc(a) putchar(a)
#define ms(a) memset(a,0,sizeof(a))
#define repi(i, a, b) for(register int i=a;i<=b;++i)
#define repd(i, a, b) for(register int i=a;i>=b;--i)
#define reps(s) for(register int i=head[s];i;i=Next[i])
#define ll long long
#define ull unsigned long long
#define vi vector<int>
#define vc vector<char>
#define pii pair<int,int>
#define pll pair<long,long>
#define pil pair<int,long>
#define pli pair<long,int>
#define mii unordered_map<int,int>
#define msi unordered_map<string,int>
#define lowbit(x) ((x)&(-(x)))
#define ce(i, r) i==r?'\n':' '
#define pb push_back
#define fi first
#define se second
#define INF 0x3f3f3f3f
#define pr(x) cout<<#x<<": "<<x<<endl
using namespace std;

inline int qr() {
    int f = 0, fu = 1;
    char c = getchar();
    while (c < '0' || c > '9') {
        if (c == '-')fu = -1;
        c = getchar();
    }
    while (c >= '0' && c <= '9') {
        f = (f << 3) + (f << 1) + c - 48;
        c = getchar();
    }
    return f * fu;
}

const int N = 1e5 + 10;
int t, n, x, cnt;
int a[N];

int main() {
    t = qr();
    while (t--) {
        n = qr(), x = qr();
        repi(i, 1, n)a[i] = qr();
        sort(a + 1, a + n + 1, greater<int>());
        if(a[1]>x){
            bool flag=false;
            repi(i,1,n)
                if(a[i]==x){
                    flag=true;
                    break;
                }
            puts(flag ? "1" : "2");
            continue;
        }
        cnt=0;
        int res=2e9;
        repi(i,1,n){
            int k=x/a[i];
            if(!k)break;
            cnt+=k,x-=a[i]*k;
            if(!x)break;
        }
        if(x)cnt++;
        pi(min(cnt,res));
    }
    return 0;
}


#include<bits/stdc++.h>

#define si(a) scanf("%d",&a)
#define sl(a) scanf("%lld",&a)
#define sd(a) scanf("%lf",&a)
#define sc(a) scahf("%c",&a);
#define ss(a) scanf("%s",a)
#define pi(a) printf("%d\n",a)
#define pl(a) printf("%lld\n",a)
#define pc(a) putchar(a)
#define ms(a) memset(a,0,sizeof(a))
#define repi(i, a, b) for(register int i=a;i<=b;++i)
#define repd(i, a, b) for(register int i=a;i>=b;--i)
#define reps(s) for(register int i=head[s];i;i=Next[i])
#define ll long long
#define ull unsigned long long
#define vi vector<int>
#define vc vector<char>
#define pii pair<int,int>
#define pll pair<long,long>
#define pil pair<int,long>
#define pli pair<long,int>
#define mii unordered_map<int,int>
#define msi unordered_map<string,int>
#define lowbit(x) ((x)&(-(x)))
#define ce(i, r) i==r?'\n':' '
#define pb push_back
#define fi first
#define se second
#define INF 0x3f3f3f3f
#define pr(x) cout<<#x<<": "<<x<<endl
using namespace std;

inline int qr() {
    int f = 0, fu = 1;
    char c = getchar();
    while (c < '0' || c > '9') {
        if (c == '-')fu = -1;
        c = getchar();
    }
    while (c >= '0' && c <= '9') {
        f = (f << 3) + (f << 1) + c - 48;
        c = getchar();
    }
    return f * fu;
}

const int N = 1e5 + 10;
int t, n, x, cnt;
int a[N];

int main() {
    t = qr();
    while (t--) {
        n = qr(), x = qr();
        repi(i, 1, n)a[i] = qr();
        sort(a + 1, a + n + 1, greater<int>());
        if(a[1]>x){
            bool flag=false;
            repi(i,1,n)
            if(a[i]==x){
                flag=true;
                break;
            }
            puts(flag ? "1" : "2");
            continue;
        }
        cnt=0;
        repi(i,1,n){
            int k=x/a[i];
            cnt+=k,x-=a[i]*k;
            if(!x)break;
        }
        if(x)cnt++;
        pi(cnt);
    }
    return 0;
}


#pragma GCC optimize(2)
#pragma GCC optimize("Ofast")
#pragma GCC optimize("inline")
#pragma GCC optimize("-fgcse")
#pragma GCC optimize("-fgcse-lm")
#pragma GCC optimize("-fipa-sra")
#pragma GCC optimize("-ftree-pre")
#pragma GCC optimize("-ftree-vrp")
#pragma GCC optimize("-fpeephole2")
#pragma GCC optimize("-ffast-math")
#pragma GCC optimize("-fsched-spec")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("-falign-jumps")
#pragma GCC optimize("-falign-loops")
#pragma GCC optimize("-falign-labels")
#pragma GCC optimize("-fdevirtualize")
#pragma GCC optimize("-fcaller-saves")
#pragma GCC optimize("-fcrossjumping")
#pragma GCC optimize("-fthread-jumps")
#pragma GCC optimize("-funroll-loops")
#pragma GCC optimize("-fwhole-program")
#pragma GCC optimize("-freorder-blocks")
#pragma GCC optimize("-fschedule-insns")
#pragma GCC optimize("inline-functions")
#pragma GCC optimize("-ftree-tail-merge")
#pragma GCC optimize("-fschedule-insns2")
#pragma GCC optimize("-fstrict-aliasing")
#pragma GCC optimize("-fstrict-overflow")
#pragma GCC optimize("-falign-functions")
#pragma GCC optimize("-fcse-skip-blocks")
#pragma GCC optimize("-fcse-follow-jumps")
#pragma GCC optimize("-fsched-interblock")
#pragma GCC optimize("-fpartial-inlining")
#pragma GCC optimize("no-stack-protector")
#pragma GCC optimize("-freorder-functions")
#pragma GCC optimize("-findirect-inlining")
#pragma GCC optimize("-fhoist-adjacent-loads")
#pragma GCC optimize("-frerun-cse-after-loop")
#pragma GCC optimize("inline-small-functions")
#pragma GCC optimize("-finline-small-functions")
#pragma GCC optimize("-ftree-switch-conversion")
#pragma GCC optimize("-foptimize-sibling-calls")
#pragma GCC optimize("-fexpensive-optimizations")
#pragma GCC optimize("-funsafe-loop-optimizations")
#pragma GCC optimize("inline-functions-called-once")
#pragma GCC optimize("-fdelete-null-pointer-checks")
#pragma GCC optimize(3)
#include<bits/stdc++.h>

#define si(a) scanf("%d",&a)
#define sl(a) scanf("%lld",&a)
#define sd(a) scanf("%lf",&a)
#define sc(a) scahf("%c",&a);
#define ss(a) scanf("%s",a)
#define pi(a) printf("%d\n",a)
#define pl(a) printf("%lld\n",a)
#define pc(a) putchar(a)
#define ms(a) memset(a,0,sizeof(a))
#define repi(i, a, b) for(register int i=a;i<=b;++i)
#define repd(i, a, b) for(register int i=a;i>=b;--i)
#define reps(s) for(register int i=head[s];i;i=Next[i])
#define ll long long
#define ull unsigned long long
#define vi vector<int>
#define vc vector<char>
#define pii pair<int,int>
#define pll pair<long,long>
#define pil pair<int,long>
#define pli pair<long,int>
#define mii unordered_map<int,int>
#define msi unordered_map<string,int>
#define lowbit(x) ((x)&(-(x)))
#define ce(i, r) i==r?'\n':' '
#define pb push_back
#define fi first
#define se second
#define INF 0x3f3f3f3f
#define pr(x) cout<<#x<<": "<<x<<endl
using namespace std;

inline int qr() {
    int f = 0, fu = 1;
    char c = getchar();
    while (c < '0' || c > '9') {
        if (c == '-')fu = -1;
        c = getchar();
    }
    while (c >= '0' && c <= '9') {
        f = (f << 3) + (f << 1) + c - 48;
        c = getchar();
    }
    return f * fu;
}

const int N = 1e5 + 10;
int t, n, x, cnt;
int a[N];
vi b;
int main() {
    t = qr();
    while (t--) {
        n = qr(), x = qr();
        repi(i, 1, n)a[i] = qr(),b.pb(a[i]);
        if(count(a+1,a+1+n,x))puts("1");
        else pi(max(2,(int)ceil(x*1.0/(*max_element(a+1,a+1+n)))));
    }
    return 0;
}


#include<iostream>
using namespace std;
typedef long long ll;

const int N = 1e5+10;

int t;
int a[N];

void solve(ll maxn,ll x)
{
	ll ans= x/maxn ;
	if(x%maxn)
		ans++;
	cout<<ans<<endl;
}

int main()
{
	cin>>t;
	while(t--)
	{
		ll n,x,maxn=0;
		cin>>n>>x;
		int flag=0;
		for(int i=1;i<=n;i++)
		{
			ll a;
			scanf("%llu",&a);
			if(a==x)
			{
				flag=1;
				break;
			}
			else if(a>x)
			{
				flag=2;
				break;
			}
			if(a>maxn)
				maxn=a;
		}

		if(flag)     //һ��
		{
			cout<<flag<<endl;
		}
		else
		{
			solve(maxn,x);
		}
	}
}


#include<iostream>
using namespace std;
typedef long long ll;

const int N = 1e5+10;

int t;
int a[N];

void solve(ll maxn,ll x)
{
	if(maxn>x) swap(maxn,x);
	ll ans= x/maxn ;
	if(x%maxn)
		ans++;
	cout<<ans<<endl;
}

int main()
{
	cin>>t;
	while(t--)
	{
		ll n,x,maxn=0;
		cin>>n>>x;
		bool flag=0;
		for(int i=1;i<=n;i++)
		{
			ll a;
			scanf("%llu",&a);
			if(a==x)
			{
				flag=1;
				goto xxx;
			}
			if(a>maxn)
				maxn=a;
		}

		if(flag)     //һ��
		{
			xxx:
			cout<<1<<endl;
		}
		else
		{
			solve(maxn,x);
		}
	}
}


#include<iostream>
using namespace std;
typedef long long ll;

const int N = 1e5+10;

int t;
int a[N];

void solve(ll maxn,ll x)
{
	ll ans= x/maxn ;
	if(x%maxn)
		ans++;
	cout<<ans<<endl;
}

int main()
{
	cin>>t;
	while(t--)
	{
		ll n,x,maxn=0;
		cin>>n>>x;
		int flag=0;
		for(int i=1;i<=n;i++)
		{
			ll a;
			scanf("%llu",&a);
			if(a==x)
			{
				flag=1;
				break;
			}
			else if(a>x)
			{
				flag=2;
			}
			if(a>maxn)
				maxn=a;
		}

		if(flag)     //һ��
		{
			cout<<flag<<endl;
		}
		else
		{
			solve(maxn,x);
		}
	}
}


#include<bits/stdc++.h>

using namespace std;

#define ff(i, a, b) for(auto i=(a); (i <= (b)); ++i)
#define FF(i, a, b) for(auto i=(a); (i >= (b)); --i)
#define ll long long

const ll M = 1000000000000;
const int N = 200000 + 10;

struct re {
    ll x, y;

    re operator + (re a) {
        return (re) {x + a.x, y + a.y};
    }

    re operator - (re a) {
        return (re) {x - a.x, y - a.y};
    }
};

ll dist(re a) {
    return a.x*a.x + a.y*a.y;
}

struct result {
    int cs, x, y;
};

bool check(re a) {
    return dist(a) <= 1E12;
}

int n, cur, f[N];
re a[N];
vector<result> res;

ll Abs(ll x) {
    return (x > 0) ? x : -x;
}

int main() {
    cin >> n;
    ff(i, 1, n) cin >> a[i].x >> a[i].y;

    if (n == 1) cout << 1; else
    if (n == 2) cout << "1 1"; else {
        set<int> b;
        vector<int> p;
        cur = n;
        ff(i, 1, n) {
            b.insert(i);
            if (b.size() == 3) {
                p.clear();
                p.insert(p.begin(), b.begin(), b.end());
                if (check(a[p[0]] + a[p[1]])) res.push_back((result) {++cur, p[0], p[1]}), b.erase(p[0]), b.erase(p[1]); else
                if (check(a[p[0]] - a[p[1]])) res.push_back((result) {++cur, p[0], -p[1]}), b.erase(p[0]), b.erase(p[1]); else
                if (check(a[p[0]] + a[p[2]])) res.push_back((result) {++cur, p[0], p[2]}), b.erase(p[0]), b.erase(p[2]); else
                if (check(a[p[0]] - a[p[2]])) res.push_back((result) {++cur, p[0], -p[2]}), b.erase(p[0]), b.erase(p[2]); else
                if (check(a[p[1]] + a[p[2]])) res.push_back((result) {++cur, p[1], p[2]}), b.erase(p[1]), b.erase(p[2]); else
                if (check(a[p[1]] - a[p[2]])) res.push_back((result) {++cur, p[1], -p[2]}), b.erase(p[1]), b.erase(p[2]);
                a[cur] = (res.back().y > 0) ? a[res.back().x] + a[res.back().y] : a[res.back().x] - a[-res.back().y];
                b.insert(cur);
            }
        }

        p.clear();
        p.insert(p.begin(), b.begin(), b.end());
        if (check(a[p[0]] + a[p[1]])) res.push_back((result) {++cur, p[0], p[1]}), b.erase(p[0]), b.erase(p[1]); else
        if (check(a[p[0]] - a[p[1]])) res.push_back((result) {++cur, p[0], -p[1]}), b.erase(p[0]), b.erase(p[1]);

        f[cur] = 1;
        for (auto i = res.rbegin(); i != res.rend(); i++) {
            auto u = *i;
            //cout << u.cs << " " << u.x << " " << u.y << endl;
            f[u.x] = f[u.cs];
            f[Abs(u.y)] = (u.y > 0) ? f[u.cs] : -f[u.cs];
        }

        ff(i, 1, n) cout << f[i] << " ";

        //re tmp = (re) {0, 0};
        //ff(i, 1, n) tmp = (f[i] > 0) ? tmp + a[i] : tmp - a[i];
        //cout << endl << tmp.x << " " << tmp.y << " " << dist(tmp);
    }
}
//This code belongs to s34vv1nd


#include<bits/stdc++.h>

using namespace std;

#define ff(i, a, b) for(auto i=(a); (i <= (b)); ++i)
#define FF(i, a, b) for(auto i=(a); (i >= (b)); --i)
#define ll long long

const ll M = 1000000000000;
const int N = 200000 + 10;

struct re {
    ll x, y;

    re operator + (re a) {
        return (re) {x + a.x, y + a.y};
    }

    re operator - (re a) {
        return (re) {x - a.x, y - a.y};
    }
};

ll dist(re a) {
    return a.x*a.x + a.y*a.y;
}

struct result {
    int cs, x, y;
};

bool check(re a) {
    return dist(a) <= 1E12;
}

int n, cur, f[N];
re a[N];
vector<result> res;

ll abs(ll x) {
    return (x > 0) ? x : -x;
}

int main() {
    cin >> n;
    ff(i, 1, n) cin >> a[i].x >> a[i].y;

    if (n == 1) cout << 1; else
    if (n == 2) cout << "1 1"; else {
        set<int> b;
        vector<int> p;
        cur = n;
        ff(i, 1, n) {
            b.insert(i);
            if (b.size() == 3) {
                p.clear();
                p.insert(p.begin(), b.begin(), b.end());
                if (check(a[p[0]] + a[p[1]])) res.push_back((result) {++cur, p[0], p[1]}), b.erase(p[0]), b.erase(p[1]); else
                if (check(a[p[0]] - a[p[1]])) res.push_back((result) {++cur, p[0], -p[1]}), b.erase(p[0]), b.erase(p[1]); else
                if (check(a[p[0]] + a[p[2]])) res.push_back((result) {++cur, p[0], p[2]}), b.erase(p[0]), b.erase(p[2]); else
                if (check(a[p[0]] - a[p[2]])) res.push_back((result) {++cur, p[0], -p[2]}), b.erase(p[0]), b.erase(p[2]); else
                if (check(a[p[1]] + a[p[2]])) res.push_back((result) {++cur, p[1], p[2]}), b.erase(p[1]), b.erase(p[2]); else
                if (check(a[p[1]] - a[p[2]])) res.push_back((result) {++cur, p[1], -p[2]}), b.erase(p[1]), b.erase(p[2]);
                a[cur] = (res.back().y > 0) ? a[res.back().x] + a[abs(res.back().y)] : a[res.back().x] - a[abs(res.back().y)];
                b.insert(cur);
            }
        }

        p.clear();
        p.insert(p.begin(), b.begin(), b.end());
        if (check(a[p[0]] + a[p[1]])) res.push_back((result) {++cur, p[0], p[1]}), b.erase(p[0]), b.erase(p[1]); else
        if (check(a[p[0]] - a[p[1]])) res.push_back((result) {++cur, p[0], -p[1]}), b.erase(p[0]), b.erase(p[1]);

        f[cur] = 1;
        for (auto i = res.rbegin(); i != res.rend(); i++) {
            auto u = *i;
            //cout << u.cs << " " << u.x << " " << u.y << endl;
            f[u.x] = f[u.cs];
            f[abs(u.y)] = (u.y > 0) ? f[u.cs] : -f[u.cs];
        }

        ff(i, 1, n) cout << f[i] << " ";

        //re tmp = (re) {0, 0};
        //ff(i, 1, n) tmp = (f[i] > 0) ? tmp + a[i] : tmp - a[i];
        //cout << endl << tmp.x << " " << tmp.y << " " << dist(tmp);
    }
}
//This code belongs to s34vv1nd


#include<bits/stdc++.h>

using namespace std;

#define ff(i, a, b) for(auto i=(a); (i <= (b)); ++i)
#define FF(i, a, b) for(auto i=(a); (i >= (b)); --i)
#define ll long long

const ll M = 1000000000000;
const int N = 200000 + 10;

struct re {
    ll x, y;

    re operator + (re a) {
        return (re) {x + a.x, y + a.y};
    }

    re operator - (re a) {
        return (re) {x - a.x, y - a.y};
    }
};

ll dist(re a) {
    return a.x*a.x + a.y*a.y;
}

struct result {
    int cs, x, y;
};

bool check(re a) {
    return dist(a) <= M;
}

int n, cur, f[N];
re a[N];
vector<result> res;

ll Abs(ll x) {
    return (x > 0) ? x : -x;
}

int main() {
    cin >> n;
    ff(i, 1, n) cin >> a[i].x >> a[i].y;

    if (n == 1) cout << 1; else {
        set<int> b;
        vector<int> p;
        cur = n;
        ff(i, 1, n) {
            b.insert(i);
            if (b.size() == 3) {
                p.clear();
                p.insert(p.begin(), b.begin(), b.end());
                cur++;
                if (check(a[p[0]] + a[p[1]])) res.push_back((result) {cur, p[0], p[1]}), b.erase(p[0]), b.erase(p[1]); else
                if (check(a[p[0]] - a[p[1]])) res.push_back((result) {cur, p[0], -p[1]}), b.erase(p[0]), b.erase(p[1]); else
                if (check(a[p[0]] + a[p[2]])) res.push_back((result) {cur, p[0], p[2]}), b.erase(p[0]), b.erase(p[2]); else
                if (check(a[p[0]] - a[p[2]])) res.push_back((result) {cur, p[0], -p[2]}), b.erase(p[0]), b.erase(p[2]); else
                if (check(a[p[1]] + a[p[2]])) res.push_back((result) {cur, p[1], p[2]}), b.erase(p[1]), b.erase(p[2]); else
                if (check(a[p[1]] - a[p[2]])) res.push_back((result) {cur, p[1], -p[2]}), b.erase(p[1]), b.erase(p[2]);
                a[cur] = (res.back().y > 0) ? a[res.back().x] + a[res.back().y] : a[res.back().x] - a[-res.back().y];
                b.insert(cur);
            }
        }

        p.clear();
        p.insert(p.begin(), b.begin(), b.end());
        cur++;
        if (dist(a[p[0]] + a[p[1]]) < dist(a[p[0]] - a[p[1]]))
            res.push_back((result) {cur, p[0], p[1]}), b.erase(p[0]), b.erase(p[1]);
        else
            res.push_back((result) {cur, p[0], -p[1]}), b.erase(p[0]), b.erase(p[1]);

        f[cur] = 1;
        for (auto i = res.rbegin(); i != res.rend(); i++) {
            auto u = *i;
            //cout << u.cs << " " << u.x << " " << u.y << endl;
            f[u.x] = f[u.cs];
            f[Abs(u.y)] = (u.y > 0) ? f[u.cs] : -f[u.cs];
        }

        ff(i, 1, n) cout << f[i] << " ";

        //re tmp = (re) {0, 0};
        //ff(i, 1, n) tmp = (f[i] > 0) ? tmp + a[i] : tmp - a[i];
        //cout << endl << tmp.x << " " << tmp.y << " " << dist(tmp);
    }
}
//This code belongs to s34vv1nd