#include<stdio.h>
long long int n,k;
int main()
{
    int t;
    scanf("%d",&t);
    while(t--)
    {
        long long int a;
        int i=1;
        scanf("%lld%lld",&n,&k);
        if(n>k)
        {
            if(n%k==0)
                printf("1\n");
            else if(n>2*k)
            {
                printf("2\n");
            }
            else
                printf("%lld\n",n/k+1);
        }
        else
        {
            if(k%n==0)
                printf("%lld\n",k/n);
            else
                printf("%lld\n",k/n+1);
        }
    }
}


				 	   		  			  							   			