Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma GCC optimize ("O3")
- //#pragma GCC target ("avx2")
- #pragma GCC target (sse, sse2, sse3, popcnt, tune=native)
- #include <bits/stdc++.h>
- /** FAST ALLOCATION */
- /*
- const int MAX_MEM = 1e8;
- int mpos = 0;
- char mem[MAX_MEM];
- inline void* operator new(size_t n) {
- char *res = mem + mpos;
- mpos += n;
- assert(mpos <= MAX_MEM);
- return (void*) res;
- }
- inline void operator delete(void * ) {}
- */
- using namespace std;
- #define loop(i, n) for(int i = 0; i < n; ++i)
- #define vec vector
- #define all(x) x.begin(), x.end()
- #define rall(x) x.rbegin(), x.rend()
- #define paii pair<int, int>
- #define fr first
- #define sc second
- #define pb push_back
- #define SZ(x) (int) x.size()
- #define FOR(i, a, n) for(int i = a; i < n; ++i)
- #define Unique(x) x.erase(unique(all(x)), x.end())
- #define int long long
- const int inf = 1e9 + 47;
- int n, m;
- vec<int> val;
- void read() {
- cin >> n >> m;
- int ans = inf;
- loop(i, n) {
- int t;
- cin >> t;
- if(t == m) ans = 1;
- else if(t > m) ans = min(ans, 2LL);
- else ans = min(ans, (m - 1) / t + 1);
- }
- cout << ans << endl;
- }
- void solve() {
- }
- signed main() {
- ios_base::sync_with_stdio(0);
- cin.tie(0);
- #ifdef COFFEE_MACHINE
- freopen("input.cpp", "r", stdin);
- freopen("output.cpp", "w", stdout);
- #endif
- int t = 1;
- cin >> t;
- while(t--) {
- read();
- solve();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement