#include <bits/stdc++.h>
#define pb(a)           push_back(a)
#define ll              long long int
#define scd(a)          scanf("%d",&a)
#define mp(a,b)         make_pair(a,b)
#define scl(a)          scanf("%I64d",&a)
#define scdd(a,b)       scanf("%d %d",&a,&b)
#define srt(a)          sort(a.begin(),a.end())
#define rsrt(a)         sort(a.rbegin(),a.rend())
#define scll(a,b)       scanf("%I64d %I64d",&a,&b)
#define vll             vector<ll>
#define pi              acos(-1.0)
#define inf             9223372036854775807
#define ff              first
#define ss              second
#define mod             1000000007

using namespace std;

int main()
{
    ll T;
    scl(T);
    while(T--)
    {
        ll n,k,m,i,j,t,res=0;
        vector<ll>vv;
        cin>>n>>k;
        if(n%k==0)cout<<1<<endl;
        else if(n>k)cout<<2<<endl;
        else cout<<((k+n-1)/n)<<endl;
    }
}
