#include<bits/stdc++.h>
#define ll long long
#define pb push_back
long long int mod = (long long int)1000000007;
using namespace std;

void solve()
{
    ll i,j,k,n;
    std::cout.precision(10);
    int yes=0;
    cin>>n>>k;
    ll p;
    if(n%k==0)
    {
        p=n/k;
    }
    else
    {
        p=n/k+1;
    }
    k=p*k;
    if(k%n==0)
    {
        cout<<k/n;
    }
    else
    {
        cout<<k/n+1;
    }
}

int main()
{
    ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
    int i,j,k;
    int t;
    std::cout.precision(10);
    cin>>t;
    while(t--)
    {
        solve();
        cout<<"\n";
    }
}