#include<bits/stdc++.h>
typedef long long ll;
#define f(i,a,n) for(long long i=a;i<n;i++)
using namespace std;
ll gcd(ll a,ll b)
{
    if(b==0)return (a);
    return gcd(b,a%b);
}


int main()
{   
    ll t;
    cin>>t;
    while(t--)
    {
        ll n,k;cin>>n>>k;
        ll ans;
        ll sum=n;
        if(n%k==0)
        ans=1;
      
        else{
            sum=k*(1+(n/k));
            ans=(ll)ceil(sum*1.0/n);
            // cout<<sum<<" ";
        }
        cout<<ans<<endl;
        
        

    }
}