#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 7;
const double eps = 1e-6;
const int mod = 1e9 + 7;
int a[N];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int n, s;
    cin >> n >> s;
    int d = n + 1 >> 1;
    cout << s / (n - d + 1) << endl;
  }
  return 0;
}
