#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
void solve()
{
	ll n,k;
	cin>>n>>k;
	if(k>=n)
	{
		if(k%n==0)
		cout<<k/n<<endl;
		else
		cout<<k/n+1<<endl;
	}
	else
	if(n%k==0)
	cout<<1<<endl;
	else
	cout<<2<<endl;
}
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	//clock_t z=clock();
	ll tt=1;

	cin>>tt;
	while(tt--)
		solve();
		// printf("\nTime taken %0.4lf\n",(double)(clock()-z)/(CLOCKS_PER_SEC));
}