#include<iostream>
using namespace std;
int main()
{
	int t;
	cin>>t;
	while(t--)
	{
        int n,k;
        cin>>n>>k;
        if(n<=k)
        {
            cout<<(n+k-1)/n<<endl;
        }
        else
        {
            if(n%k==0)
            {
                cout<<"1"<<endl;
            }
            else
            {
                cout<<"2"<<endl;
            }
            
        }
        
	}
	return 0;
}