#include<iostream> using namespace std; int main(){ int t; cin >> t; while(t--){ int n, k; cin >> n >> k; cout << k / 2 << '\n'; } return 0; }