#include <iostream>
#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main() {
    int t;
    cin>>t;
    while(t--)
    {
        ll n,k;
        cin>>n>>k;
        if(n==k)
        cout<<1<<endl;
        else if(n==1)
        cout<<k<<endl;
        else if(k==1)
        cout<<1<<endl;
        else if((k%n==0) and (k>n))
        cout<<k/n<<endl;
        else if((n%k==0) and (n>k))
        cout<<1<<endl;
        else if((k%n!=0)and (k>n))
        cout<<(k/n)+1<<endl;
        else if((n%k!=0) and (n>k))
        {
            ll val=(n/k)+1;
            k=k*val;
            cout<<(k/n)+1<<endl;
        }

    }
}
