#include<iostream>
#include <bits/stdc++.h>
using namespace std;
using ll = long long;

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

    