#include "bits/stdc++.h"
#include <thread>
#include <mutex>
using namespace std;
#define pb push_back
#define ff first
#define ss second
#define endl '\n'
#define fast ios::sync_with_stdio(false); cin.tie(NULL);
#ifdef LOCAL
#include "debug.h"
#else
#define debug(x...)
#endif

#define int long long


void solve(){
	
	int n , k;
	cin>>n>>k;
	int val = (n/k)*k;
	if(val < n)
		val += k;
	int ans = val/n + (val%n!=0);
	cout<<ans<<endl;
}

 
signed main(){
	
	fast;
	int t = 1;
	cin>>t;
	while(t--)
		solve();
}