#include <bits/stdc++.h>
#define FASTIO cin.tie(0), cout.tie(0), ios::sync_with_stdio(0)
using namespace std;
using ll = long long;
using ld = long double;
using ull = unsigned long long;


int main() {
	FASTIO;
	int q;
	cin >> q;
	while (q--) {
		int n, k;
		cin >> n >> k;
		if (n > k) {
			if (n % k == 0)
				cout << 1 << '\n';
			else
				cout << 2 << '\n';
		} else
			cout << (k + n - 1) / n << '\n';
	}
	return 0;
}
