#include<bits/stdc++.h>
 
#define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define int long long
#define rep(i,a,b)    for(int i=a;i<b;i++)
#define repn(i,a,b)   for(int i=a;i>=b;i--)
#define F first
#define S second
#define pii pair<int,int>
#define vi vector<int>
#define vii vector<pii>
#define pb push_back
#define mp  make_pair
#define all(v) (v).begin(), (v).end()
#define mod 1000000007
#define inf 1e18 
 
using namespace std;

signed main()
{
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output1.txt", "w", stdout);
    #endif
    
    IOS;
    int t;
    cin>>t;
    while(t--)
    {
        int n,i,a,b;
        int k;
        cin>>n>>k;
        if(n==1)
        {
            cout<<k<<endl;
            continue;
        }
        if(k<n)
        {
            int num=n/k;
            if(n%k!=0) num++;
            k=num*k;
        }
        k-=n;
        a=k/(n);
        if(k%(n)!=0)a++;
        cout<<a+1<<endl;
    }
}
    