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

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