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

int main() {
#ifndef ONLINE_JUDGE
	freopen("in.in", "r", stdin);
//	freopen("out.out", "w", stdout);
#endif
	int T; cin >> T;
	while(T --) {
		int n, k; cin >> n >> k;
		if(n % k == 0) cout << 1 << endl;
		else cout << max(2, (k + n - 1) / n) << endl;
	}
	return 0;
}
         