Advertisement
Guest User

Untitled

a guest
Feb 17th, 2020
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. #pragma GCC optimize ("O3")
  2. //#pragma GCC target ("avx2")
  3. #pragma GCC target (sse, sse2, sse3, popcnt, tune=native)
  4.  
  5. #include <bits/stdc++.h>
  6.  
  7. /** FAST ALLOCATION */
  8. /*
  9. const int MAX_MEM = 1e8;
  10. int mpos = 0;
  11. char mem[MAX_MEM];
  12. inline void* operator new(size_t n) {
  13. char *res = mem + mpos;
  14. mpos += n;
  15. assert(mpos <= MAX_MEM);
  16. return (void*) res;
  17. }
  18. inline void operator delete(void * ) {}
  19. */
  20. using namespace std;
  21.  
  22. #define loop(i, n) for(int i = 0; i < n; ++i)
  23. #define vec vector
  24. #define all(x) x.begin(), x.end()
  25. #define rall(x) x.rbegin(), x.rend()
  26. #define paii pair<int, int>
  27. #define fr first
  28. #define sc second
  29. #define pb push_back
  30. #define SZ(x) (int) x.size()
  31. #define FOR(i, a, n) for(int i = a; i < n; ++i)
  32. #define Unique(x) x.erase(unique(all(x)), x.end())
  33.  
  34. #define int long long
  35.  
  36. const int inf = 1e9 + 47;
  37.  
  38. int n, m;
  39. vec<int> val;
  40.  
  41. void read() {
  42. cin >> n >> m;
  43. int ans = inf;
  44. loop(i, n) {
  45. int t;
  46. cin >> t;
  47. if(t == m) ans = 1;
  48. else if(t > m) ans = min(ans, 2LL);
  49. else ans = min(ans, (m - 1) / t + 1);
  50. }
  51. cout << ans << endl;
  52. }
  53.  
  54. void solve() {
  55. }
  56.  
  57. signed main() {
  58. ios_base::sync_with_stdio(0);
  59. cin.tie(0);
  60.  
  61. #ifdef COFFEE_MACHINE
  62. freopen("input.cpp", "r", stdin);
  63. freopen("output.cpp", "w", stdout);
  64. #endif
  65.  
  66. int t = 1;
  67. cin >> t;
  68. while(t--) {
  69. read();
  70. solve();
  71. }
  72. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement