description: You are given two positive integers n and s. Find the maximum possible median of an array of n non-negative integers (not necessarily distinct), such that the sum of its elements is equal to s.
  
  A median of an array of integers of length m is the number standing on the ⌈ {m/2} ⌉-th (rounding up) position in the non-decreasing ordering of its elements. Positions are numbered starting from 1. For example, a median of the array [20,40,20,50,50,30] is the ⌈ m/2 ⌉-th element of [20,20,30,40,50,50], so it is 30. There exist other definitions of the median, but in this problem we use the described definition.
  
  Input
  
  The input consists of multiple test cases. The first line contains a single integer t (1 ≤ t ≤ 10^4) — the number of test cases. Description of the test cases follows.
  
  Each test case contains a single line with two integers n and s (1 ≤ n, s ≤ 10^9) — the length of the array and the required sum of the elements.
  
  Output
  
  For each test case print a single integer — the maximum possible median.
  
  Example
  
  Input
  
  
  8
  1 5
  2 5
  3 5
  2 1
  7 17
  4 14
  1 1000000000
  1000000000 1
  
  
  Output
  
  
  5
  2
  2
  0
  4
  4
  1000000000
  0
  
  Note
  
  Possible arrays for the first three test cases (in each array the median is underlined):
  
    * In the first test case [\underline{5}] 
    * In the second test case [\underline{2}, 3] 
    * In the third test case [1, \underline{2}, 2] 
solution: import java.io.BufferedReader;
  import java.io.File;
  import java.io.FileReader;
  import java.io.IOException;
  import java.io.InputStreamReader;
  import java.io.PrintWriter;
  import java.util.ArrayList;
  import java.util.Arrays;
  import java.util.Collections;
  import java.util.StringTokenizer;
  
  public class Main {
      static int mod = 1000_000_007;
      static long mod1 = 998244353;
      static boolean memory = false;
      static FastScanner f;
      static PrintWriter pw;
      static double eps = 1e-6;
      static int oo = (int) 1e9;
  
      public static void solve() throws Exception {
          // Add your code here
          long n = f.nl();
          long s = f.nl();
  
          // if (n == 1) {
          //     pn(s);
          //     return;
          // }
          
          long lo = 0 , hi = s;
          long t = n - ((n + 1) / 2) + 1;
          long ans = 0;
          while (lo <= hi) {
              long mid = lo + ((hi - lo) / 2);
              if (mid * t <= s) {
                  ans = mid;
                  lo = mid + 1;
              }
              else {
                  hi = mid - 1;
              }
          }
          pn(ans);
      }
  
      public static void main(String[] args) throws Exception {
          if (memory)
              new Thread(null, new Runnable() {
                  public void run() {
                      try {
                          new Main().run();
                      } catch (Exception e) {
                          e.printStackTrace();
                          System.exit(1);
                      }
                  }
              }, "", 1 << 28).start();
          else
              new Main().run();
      }
  
      void run() throws Exception {
          if (System.getProperty("ONLINE_JUDGE") == null) {
              f = new FastScanner("");
              File file = new File("!out.txt");
              pw = new PrintWriter(file);
          } else {
              f = new FastScanner();
              pw = new PrintWriter(System.out);
          }
  
          int t = f.ni();
          int tt = 1;
          while (t-- > 0) {
              // p("Case #" + (tt++) + ": ");
              solve();
          }
  
          pw.flush();
          pw.close();
      }
  
      public static class FastScanner {
          BufferedReader br;
          StringTokenizer st;
  
          public FastScanner(String str) throws Exception {
              try {
                  br = new BufferedReader(new FileReader("!a.txt"));
              } catch (Exception e) {
                  e.printStackTrace();
              }
          }
  
          public FastScanner() {
              br = new BufferedReader(new InputStreamReader(System.in));
          }
  
          public String next() throws IOException {
              while (st == null || !st.hasMoreTokens())
                  st = new StringTokenizer(br.readLine());
              return st.nextToken();
          }
  
          public int ni() throws IOException {
              return Integer.parseInt(next());
          }
  
          public long nl() throws IOException {
              return Long.parseLong(next());
          }
  
          public String nextLine() throws IOException {
              return br.readLine();
          }
  
          public double nd() throws IOException {
              return Double.parseDouble(next());
          }
  
      }
  
      public static void pn(Object... o) {
          for (int i = 0; i < o.length; ++i)
              pw.print(o[i] + (i + 1 < o.length ? " " : "\n"));
      }
  
      public static void p(Object... o) {
          for (int i = 0; i < o.length; ++i)
              pw.print(o[i] + (i + 1 < o.length ? " " : ""));
      }
  
      public static void pni(Object... o) {
          for (Object obj : o)
              pw.print(obj + " ");
          pw.println();
          pw.flush();
      }
  
      public static void sort(int[] a) {
          ArrayList<Integer> l = new ArrayList<>();
          for (int i : a)
              l.add(i);
          Collections.sort(l);
          for (int i = 0; i < a.length; ++i)
              a[i] = l.get(i);
      }
  
      public static void sort(long[] a) {
          ArrayList<Long> l = new ArrayList<>();
          for (long i : a)
              l.add(i);
          Collections.sort(l);
          for (int i = 0; i < a.length; ++i)
              a[i] = l.get(i);
      }
  }