#include <bits/stdc++.h>
using namespace std;
void FastCode (){
ios_base::sync_with_stdio(0);
cin.tie(NULL);
cout.tie(NULL);
}
int main() {
FastCode();
int tt;
cin >> tt;
while(tt--){
int a , b ;
cin >> a >> b ;
cout << b/2<<endl;
}
}