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

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