感想
感觉自己像个脑残
代码
#include <iostream>
#include <cstring>
#include <algorithm>
using namespace std;
typedef long long LL;
const LL N=100010;
LL t,n,x,a[N];
int main()
{
cin>>t;
while(t--)
{
vector<int>st;
memset(a, 0, sizeof a);
cin>>n>>x;
for(LL i=1;i<=n;i++)
{
cin>>a[i];
st.push_back(a[i]);
}
sort(a+1,a+n+1);
sort(st.begin(),st.end());
LL maxx=a[n];
if(maxx>=x)
{
int temp=lower_bound(st.begin(),st.end(),x)-st.begin();
if(st[temp]==x)cout<<1<<endl;
else cout<<2<<endl;
continue;
}
if(x%maxx==0)
{
cout<<x/maxx<<endl;
continue;
}
cout<<x/maxx+1<<endl;
}
return 0;
}