#include <iostream>
#include <iterator>
using namespace std;
int main()
{
ios::sync_with_stdio(0);
cin.tie(nullptr);
cout.tie(nullptr);
istream_iterator<int> sin(cin);
ostream_iterator<int> sout(cout,"\n");
for(int t=*sin;t--;)
{
int n=*(++sin),k=*(++sin);
*(sout++)=(k*((n+k-1)/k)+n-1)/n;
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8aXRlcmF0b3I+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQgbWFpbigpCnsKICAgIGlvczo6c3luY193aXRoX3N0ZGlvKDApOwogICAgY2luLnRpZShudWxscHRyKTsKICAgIGNvdXQudGllKG51bGxwdHIpOwogICAgaXN0cmVhbV9pdGVyYXRvcjxpbnQ+IHNpbihjaW4pOwogICAgb3N0cmVhbV9pdGVyYXRvcjxpbnQ+IHNvdXQoY291dCwiXG4iKTsKICAgIGZvcihpbnQgdD0qc2luO3QtLTspCiAgICB7CiAgICAJaW50IG49KigrK3Npbiksaz0qKCsrc2luKTsKICAgIAkqKHNvdXQrKyk9KGsqKChuK2stMSkvaykrbi0xKS9uOwogICAgfQogICAgcmV0dXJuIDA7Cn0K