#include<bits/stdc++.h>
 
using namespace std;
 
#define rep(i,a,b)  for(int i = a; i < b; i++)
#define Rep(i,a,b)  for(int i = a, i <= b; i++)
#define int         long long
#define pii         pair<int,int>
#define vi          vector <int>
#define mod         1000000007
#define setbits(x)  __builtin_popcountll(x)
#define zrobits(x)  __builtin_ctzll(x)   //no of zero bits befor the first set bits
#define inf         1e18
#define ps(x,y)     fixed<<setprecision(y)<<x

int gcd(int a, int b) { return (b == 0) ? a : gcd(b, a % b); }
int lcm(int a, int b) { return (a / gcd(a, b)) * b; }

void start()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output1.txt", "w", stdout);
#endif

}



int32_t main()
{
    start();
     int t=1;;
      cin>>t;
    while(t--)
    {
    int a,b;
    cin>>a>>b;
    if(a>=b)
    {
        if(a%b==0)
        {
            cout<<1<<endl;
        }
        else
        {
            cout<<2<<endl;
        }
    
    }
    else
    {
        if(a==1)
        {
            cout<<b<<endl;
            continue;
        }
        int ans=b/a;
        if((b%a)!=0)
        {
            ans+=1;
        }
        cout<<ans<<endl;
    }


    }
}