///                            B I S M I L L A H I R  R A H M A N I R  R A H I M

#include<bits/stdc++.h>
using namespace std;

typedef bool                   boo;
typedef int                    li;
typedef long                   il;
typedef unsigned long          ul;
typedef long long int          ll;
typedef unsigned long long     ull;
typedef double                 dd;

using str =                    string;
using vli =                    vector<li>;
using vll =                    vector<ll>;
using sli =                    set<li>;
using sll =                    set<ll>;
using pli =                    pair<li, li>;
using pll =                    pair<ll, ll>;
using vpi =                    vector<pair<li, li>>;
using vpl =                    vector<pair<ll, ll>>;
using mpl =                    map<ll, ll>;
using qll =                    queue<ll>;
using stl =                    stack<ll>;

#define Test                   ll _; std :: cin >> _; while(_--)
#define input(a , n)           for( int i = 0 ; i < n ; i++ ) std :: cin >> a[i];
#define lp(a , i , b)          for( ll i = a ; i < b ; i++ )
#define rlp(a , i , b)         for( ll i = a; i > = b ; i-- )
#define llmx                   LLONG_MAX
#define sz(x)                  x.size()
#define min3(a, b, c)          min(a, min(b, c))
#define max3(a, b, c)          max(a, max(b, c))
#define min4(a, b, c, d)       min(min(a, b), min(c, d))
#define max4(a, b, c, d)       max(max(a, b), max(c, d))
#define max5(a, b, c, d, e)    max(max3(a, b, c), max(d, e))
#define min5(a, b, c, d, e)    min(min3(a, b, c), min(d, e))
#define all(z)                 z.begin() , z.end()
#define ci(x)                  std :: cin >> x;
#define co(x)                  std :: cout << x nl;
#define fix(x)                 fixed << setprecision(x)
#define mem(z , l)             memset( z , l , sizeof(z) )
#define lb(v, i)               lower_bound(len(v), i) - v.begin()
#define ub(v, i)               upper_bound(len(v), i) - v.begin()
#define MP                     make_pair
#define pb                     push_back
#define F                      first
#define S                      second
#define nl                     << '\n';
#define nll                    std :: cout << '\n';
#define sp                     << " " <<
#define sl                     << " ";
#define cy                     std :: cout << "YES" << '\n';
#define cn                     std :: cout << "NO" << '\n';
#define case()                 std :: cout<<"Case "<<++o_O<<": ";
#define go                     return;
#define Good_Bye               return 0;
#define gcd(a , b)             __gcd( a , b )
#define lcm(a , b)             ( a * ( b / gcd( a , b ) ) )
#define Faster                 ios_base :: sync_with_stdio( 0 ); cin.tie( 0 ); cout.tie( 0 );
#define Input_txt()            freopen( "input.txt" , "r" , stdin ); freopen( "output.txt" , "w" , stdout );

const double eps =             1e-9;
const int INF =                2000000000;
const ll infLL =               9000000000000000000;
const ll MOD =                 1e9+7;
const double PI =              3.141592653589793238462643383279;
long long o_O =                0;
long long ceil(ll x, ll y)     { return x/y+(x%y!=0); }

int dx[] =                     { 0 , 0 , +1 , -1 , +1 , +1 , -1 , -1 };
int dy[] =                     { +1 , -1 , 0 , 0 , +1 , -1 , +1 , -1 };

//long long _pow(ll p , ll q);
//long long pow_mod(ll x, ll n, ll m, ll k=1);
//long long mod_inverse(ll n);
//long long factorial(ll f);
//bool is_prime(ll n);

///_____________________________________________ L E T ' S  B E G I N ____________________________________________________________
const int mX = 3e5+123;
ll n, k;

void case_i()
{
    cin>>n>>k;
    if(n>k)
    {
        ll p=n-k;
        k+=ceil(p, k)*k;
    }
    cout<<ceil(k, n) nl
}

int32_t main()
{
    //Input_txt();
    Faster
    Test
    case_i();
    Good_Bye
}

//||||||||||||||||||||||||||||||||||||||||||||||||||| deadbeat_ ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

ll _pow(ll p , ll q)
{
    if(q==0) return 1;
    return p*_pow(p, q-1);
}

ll pow_mod(ll x, ll n, ll m, ll k=1)
{
    x%=m;
    while(n>0)
    {
        if(n&1)
            k=(k*x)%m;
        x=(x*x)%m;
        n>>=1;
    }
    return k;
}

ll mod_inverse(ll n)
{
    return pow_mod(n ,MOD-2, MOD);
}

ll factorial(ll f)
{
    if(f<2) return 1;
    return f*factorial(f-1);
}

bool is_prime(ll n)
{
    if(n<=3 and n!=1) return 1;
    if(n%2==0 or n%3==0) return 0;

    for(ll i=5; i*i<=n; i+=6)
        if(n%i==0 or n%(i+2)==0)
            return 0;

    return 1;
}

void sieve_prime_generator(ll n, bool vis[], vector<ll>&prime)
{
    prime.pb(2);
    for(ll i=3 ; i<=n; (!vis[i]) ? prime.push_back(i), i+=2 : i+=2) //for check i*i<=n;
        if(!vis[i])
            for(ll j=i*i ; j<=n ; vis[j]=true, j+=(2*i));
}

void prime_factorization(ll n, vector<pair<ll, ll>>&prime_fact, vector<ll>&prime, ll k=0)
{
    prime_fact.clear();
    for(auto i : prime)
    {
        if(i*i>n) break;
        while (n%i==0)
            n/=i, k++;
        if(k)
        prime_fact.push_back({i, k}), k=0;
    }
    if(n>1)
        prime_fact.push_back({n, 1});
}

void total_divisors(ll a[], ll n)
{
    for(ll i=1; i*i<=n; i++)
        for(ll j=i*i; j<n; j+=i)
            if(j==i*i)
                a[j]++;
            else
                a[j]+=2;
}

void sum_of_divisors(ll a[], ll n)
{
    for(ll i = 1; i*i <= n; i++)
        for(ll j = i*i; j<n; j += i)
            if(j == i*i)
                a[j] += i;
            else
                a[j] += i+j/i;
}

void dfs(ll i, bool vis[], vector<ll>v[])
{
    vis[i] = true;
    for(auto j : v[i])
        if(!vis[j])
            dfs(j, vis, v);
}

void bfs(ll i, vector<ll>v[], ll lev[])
{
    //mem(lev, -1);
    queue<ll>q;
    q.push(i); lev[i]=0;
    while(!q.empty())
    {
        ll u=q.front(); q.pop();
        for(auto j : v[u])
            if(lev[j]==-1 or lev[j]>lev[u]+1)
            {
                lev[j]=lev[u]+1;
                q.push(j);
            }
    }
}
