#include<bits/stdc++.h>

using namespace std;

#define endl '\n'
typedef long long ll;

void solve(){

  int n , k;
  cin >> n >> k;
  if(n <= k){
    cout << k / n + (k % n > 0 ? 1 : 0) << endl;
  }else{
    // cerr << "B" << endl;
    if(n % k == 0){
      cout << 1 << endl;
    }else{
      cout << 2 << endl;
    }
  }
}

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

  int tc;
  cin >> tc;
  for(int cc = 1; cc <= tc; cc++){
    // cout << "Case #" << cc << ": ";
    solve();
  }
}
