import math
for _ in range(int(input())):
n,k = map(int,input().split())
if k==1:
print(1)
elif n>k:
if n%k==0:
print(1)
else:
print(2)
elif n==k:
print(1)
else:
print(math.ceil(k/n))
#include<bits/stdc++.h>
using namespace std;
//Aliases
using ll = long long;
using ld = long double;
using ull = unsigned long long;
//macros
#define nline "\n"
#define MOD 1e9 + 7
#define INF 1e18
#define int long long
#define all(x) begin(x), end(x)
#define Debug(x) cout << #x << " = " << x << "\n"
#define pb emplace_back
// operator overloading
template <typename T> // cin >> vector<T>
istream& operator>>(istream& istream, vector<T>& v)
{
for (auto& it : v)
cin >> it;
return istream;
}
template <typename T> // cout << vector<T>
ostream &operator<<(ostream &ostream, const vector<T> &c)
{
for (auto &it : c)
cout << it << " ";
return ostream;
}
//Mathematical Function
int GCD(int a, int b)
{
while (b)
{
a %= b;
swap(a, b);
}
return a;
}
int mod_add(int a, int b, int m=MOD)
{
a = a % m;
b = b % m;
return (((a + b) % m) + m) % m;
}
int mod_mul(int a, int b, int m=MOD)
{
a = a % m;
b = b % m;
return (((a * b) % m) + m) % m;
}
int mod_sub(int a, int b, int m=MOD)
{
a = a % m;
b = b % m;
return (((a - b) % m) + m) % m;
}
// Calculating Power
int modpow(int x, int n, int m = MOD)
{
if (x == 0 && n == 0)
return 0; // undefined case
ll res = 1;
while (n > 0)
{
if (n % 2)
res = mod_mul(res,x);
x = mod_mul(x,x);
n /= 2;
}
return res;
}
// Modulo Inverse
int modinv(int x, int m = MOD)
{
return modpow(x, m - 2, m);
}
int binpow(int a, int b) {
if (b == 0)
return 1;
int res = binpow(a, b / 2);
if (b % 2)
return res * res * a;
else
return res * res;
}
/*---------------------------------------------------------------------------------*/
void shubham()
{
int n,k;
cin>>n>>k;
int start=0;
int end=1e9;
int ans=0;
while(start<=end){
int mid=(start+end)/2;
if(n*mid>=k){
ans=mid;
end=mid-1;
}
else{
start=mid+1;
}
}
if(ans==1&&(ans*n)%k!=0){
cout<<ans+1<<"\n";
return;
}
cout<<ans<<"\n";
}
signed main(){
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
freopen("error.txt","w",stderr);
#endif
//fast io
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout << setprecision(12) << fixed;
int tt=1;
cin>>tt;
while(tt--){
shubham();
}
}
1422A - Fence | 21D - Traveling Graph |
1559B - Mocha and Red and Blue | 1579C - Ticks |
268B - Buttons | 898A - Rounding |
1372B - Omkar and Last Class of Math | 1025D - Recovering BST |
439A - Devu the Singer and Churu the Joker | 1323A - Even Subset Sum Problem |
1095A - Repeating Cipher | 630F - Selection of Personnel |
630K - Indivisibility | 20B - Equation |
600B - Queries about less or equal elements | 1015A - Points in Segments |
1593B - Make it Divisible by 25 | 680C - Bear and Prime 100 |
1300A - Non-zero | 1475E - Advertising Agency |
1345B - Card Constructions | 1077B - Disturbed People |
653A - Bear and Three Balls | 794A - Bank Robbery |
157A - Game Outcome | 3B - Lorry |
1392A - Omkar and Password | 489A - SwapSort |
932A - Palindromic Supersequence | 433A - Kitahara Haruki's Gift |