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

typedef long long ll;

void solve()
{
	ll n,k;
	cin >> n >> k;
	if(k == 1){
		cout << 1 << endl;
		return;
	}
	if(k < n)
	{
		if(n % k == 0) cout << 1 << endl;
		else cout << 2 << endl;
	}
	else
		cout << (k/n)+( (k%n == 0)? 0:1 ) << endl;
}

int main()
{
	int T; cin >> T;
	while(T--)
		solve();
}