#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define fi first
#define se second
void MOUST(){
ios_base::sync_with_stdio(0);
cin.tie(0);
}
int main(){
MOUST();
int q;cin>>q;
while(q--){
ll n,k;cin>>n>>k;
cout<<k/2<<"\n";
}
}