#include<bits/stdc++.h>
#define int long long int 
using namespace std;
 
int ceil(int a,int b)
{
    if(a%b==0)
    return a/b;
 
    return a/b+1;
}
 
int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    #ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    #endif
 
    int t;cin>>t;
    while(t--)
    {
        int n,k,p=0;cin>>n>>k;
        int sum=0;
 
        k = k* ceil(n,k);
        
 
 
        for(int i=0;i<n;i++)
        {sum+= k/n;
            p+=i;
        }
 
       
        
        if(sum%k==0)
        {
            cout<<k/n;
        }
        else
        {
            cout<<k/n+1;
        }
 
 
        cout<<endl;
    }
    
    return 0;
}