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: """
  from functools import reduce
  import statistics
  import numpy as np
  import itertools
  import statistics
  import operator
  import decimal
  sys.setrecursionlimit(10 ** 6 + 1)
  MAX = sys.maxsize
  """
  # from time import time
  import math
  import os
  import sys
  # from math import *
  from io import BytesIO, IOBase
  from collections import Counter, deque
  # from bisect import bisect_right, insort_right
  BUFSIZE = 8192
  import array
  
  
  class FastIO(IOBase):
      newlines = 0
  
      def __init__(self, file):
          self._fd = file.fileno()
          self.buffer = BytesIO()
          self.writable = "x" in file.mode or "r" not in file.mode
          self.write = self.buffer.write if self.writable else None
  
      def read(self):
          while True:
              b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
              if not b:
                  break
              ptr = self.buffer.tell()
              self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
          self.newlines = 0
          return self.buffer.read()
  
      def readline(self):
          while self.newlines == 0:
              b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
              self.newlines = b.count(b"\n") + (not b)
              ptr = self.buffer.tell()
              self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
          self.newlines -= 1
          return self.buffer.readline()
  
      def flush(self):
          if self.writable:
              os.write(self._fd, self.buffer.getvalue())
              self.buffer.truncate(0), self.buffer.seek(0)
  
  
  class IOWrapper(IOBase):
      def __init__(self, file):
          self.buffer = FastIO(file)
          self.flush = self.buffer.flush
          self.writable = self.buffer.writable
          self.write = lambda s: self.buffer.write(s.encode("ascii"))
          self.read = lambda: self.buffer.read().decode("ascii")
          self.readline = lambda: self.buffer.readline().decode("ascii")
  
  sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
  input = lambda: sys.stdin.readline().rstrip("\r\n")
  getint = lambda: int(sys.stdin.readline().rstrip("\r\n"))
  getints = lambda: map(int, sys.stdin.readline().rstrip("\r\n").split())
  lgetints = lambda: list(map(int, sys.stdin.readline().rstrip("\r\n").split()))
  getstrs = lambda: map(str, sys.stdin.readline().rstrip("\r\n").split())
  
  
  # d is a dictionary min val of d is
  # d = { 1 : 2, 4 : 5, 3 : 0}
  # min(d.values())
  # ans = 0
  
  # def gcd(a, b):
  #     if a == 0:
  #         return b
  #     else:
  #         return gcd(b % a, a)
  
  # def fact(num):
  #     cnt = 0
  #     for x in range(1, int(math.sqrt(num)) + 1):
  #         if num % x == 0:
  #             cnt = x
  #             # if num // x == x:
  #                 # cnt += 1
  #             # else:
  #                 # cnt += 2
  #     return cnt
  
  # def isPrime(num):
  #     if num == 2:
  #         return True
  #     elif num % 2 == 0:
  #         return False
  #     else:
  #         i = 3
  #         while i * i <= num:
  #             if num % i == 0:
  #                 return False
  #             i += 2
  #         return True
  
  # def power(x, y):
  #     res = 1
  #     x = x
  #     while y > 0:
  #         if y & 1:
  #             res = res * x
  #         x = x * x
  #         y = y >> 1
  #     return res
  
  def prog_name():
      # A
      n, s = getints()
      if n == 1:
          print(s)
      else:
          if n & 1:
              n -= n // 2
          else:
              n -= (n // 2 - 1)
          print(s // n)
  
      
      # print()
  def main ():
      # init = time()
      # T = getint()
      T = getint()
      for unique in range(T):
          # print("Case #"+str(unique+1)+":", end = " ")
          # print()
          prog_name()
      # print(time() - init)
  
  
  if __name__ == "__main__":
      main()