#include<bits/stdc++.h>
#define ll long long
using namespace std;
ll T,n,k;
void work(){
	scanf("%lld%lld",&n,&k);
	if(n<=k){printf("%lld\n",(long long)ceil((double)k*1.0/(double)n));return;}
	else{
		if(n%k==0){
			printf("%lld\n",1LL);
			return;
		}
		else printf("%lld\n",2LL);
	}
	return;
}
int main(){
	scanf("%d",&T);
	while(T--)work();	
	return 0;
}