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 $\lceil {\frac{m}{2}} \rceil$-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 $\lceil \frac{m}{2} \rceil$-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 \le t \le 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 \le n, s \le 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.


-----Examples-----

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]$

Source: codeforces | Difficulty: EASY
Tags: Sorting

Mathematics

Greedy algorithms


Solutions:
from sys import stdin, stdout
t = int(stdin.readline())
while t > 0:
	(n, s) = map(int, stdin.readline().split())
	ls = s
	res = ls // (n - (n - 1) // 2)
	print(res)
	t = t - 1


import math as m
for i in range(int(input())):
	(n, s) = map(int, input().split())
	if n == 1:
		print(s)
	else:
		z = m.ceil(n / 2)
		k = n - (z - 1)
		print(s // k)


for _ in range(int(input())):
	(n, m) = map(int, input().split())
	j = (n - 1) // 2
	print(m // (n - j))


import atexit, io, sys, math, heapq

def get_int():
	return int(sys.stdin.readline().strip())

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def get_list():
	return list(map(int, sys.stdin.readline().strip().split()))

def get_string():
	return sys.stdin.readline().strip()

def write_int(a):
	sys.stdout.write(str(a) + '\n')

def write_str(a):
	sys.stdout.write(a + '\n')

def write_list(arr):
	sys.stdout.write(' '.join(map(str, arr)) + '\n')

def swap(arr, a, b):
	arr[a] ^= arr[b]
	arr[b] ^= arr[a]
	arr[a] ^= arr[b]

def int_len(a):
	return math.floor(math.log(a, 10)) + 1

def isPowerOfTwo(x):
	return x and (not x & x - 1)

def Sieve(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	res = []
	for i in range(2, len(prime)):
		if prime[i]:
			res.append(i)
	return res

def binarySearch(arr, l, r, x):
	if r >= l:
		mid = l + (r - l) // 2
		if arr[mid] == x:
			return mid
		elif arr[mid] > x:
			return binarySearch(arr, l, mid - 1, x)
		else:
			return binarySearch(arr, mid + 1, r, x)
	else:
		return -1

def search(arr, x):
	return binarySearch(arr, 0, len(arr) - 1, x)

def toString(A):
	return ''.join(A)

def toArray(str):
	return str.split()

def arrSum(Arr):
	Sum = 0
	for i in range(len(Arr)):
		Sum += Arr[i]
	return Sum

def computeXOR(n):
	if n % 4 == 0:
		return n
	if n % 4 == 1:
		return 1
	if n % 4 == 2:
		return n + 1
	return 0
N = get_int()
while N > 0:
	Arr = get_list()
	A = Arr[0]
	B = Arr[1]
	med = A // 2
	if A % 2 == 1:
		med += 1
	if A == 1:
		print(B)
	else:
		med -= 1
		A -= med
		ans = B // A
		print(ans)
	N -= 1


import sys
from collections import Counter
import math
import heapq
from itertools import accumulate
from collections import defaultdict
from collections import Counter
from itertools import zip_longest
num_cases = int(sys.stdin.readline().strip())
for case in range(1, num_cases + 1):
	(N, S) = list(map(int, sys.stdin.readline().split()))
	if N == 1:
		print(S)
	else:
		front = math.ceil(N / 2) - 1
		end = N - front
		mock = S // end
		print(mock)


t = int(input())
q = []
printff = []
for i in range(t):
	(n, s) = map(int, input().split())
	if int(n / 2) == n / 2:
		m = n / 2
	else:
		m = (n + 1) / 2
	mod = int(s / (n - m + 1))
	printff.append(mod)
for i in range(len(printff)):
	print(printff[i])


for _ in range(int(input())):
	(n, s) = map(int, input().split())
	print(s // (n // 2 + 1))


import sys

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def get_list():
	return list(map(int, sys.stdin.readline().strip().split()))

def get_list_string():
	return list(map(str, sys.stdin.readline().strip().split()))

def get_string():
	return sys.stdin.readline().strip()

def get_int():
	return int(sys.stdin.readline().strip())

def get_print_int(x):
	sys.stdout.write(str(x) + '\n')

def get_print(x):
	sys.stdout.write(x + '\n')

def get_print_int_same(x):
	sys.stdout.write(str(x) + ' ')

def get_print_same(x):
	sys.stdout.write(x + ' ')
from sys import maxsize
from math import floor

def solve():
	for _ in range(get_int()):
		(n, s) = get_ints()
		get_print_int(s // (n // 2 + 1))
solve()


def solve(n, s):
	if n % 2 == 0:
		num_zeros = max(0, n // 2 - 1)
	else:
		num_zeros = n // 2
	n -= num_zeros
	return int(s / n)
num = int(input())
for _ in range(num):
	(n, s) = [int(val) for val in input().split()]
	print(solve(n, s))


t = int(input())
for tt in range(t):
	(n, s) = [int(i) for i in input().split(' ')]
	ans = n // 2 + 1
	ans = s // ans
	print(ans)


for j in range(int(input())):
	(n, s) = map(int, input().split())
	m = n // 2 + 1
	x = s // m
	print(x)


num = int(input())
arr = [[int(i) for i in input().split()] for j in range(num)]
for line in arr:
	if line[0] == 1:
		print(line[1])
	elif line[0] > line[1] and line[1] == 1:
		print(0)
	else:
		a = line[0] // 2 + 1
		print(line[1] // a)


from math import *
n = int(input())
t = [list(map(int, input().split())) for i in range(n)]

def median(x, y):
	n = floor(x / 2) + 1
	return floor(y / n)
for i in range(n):
	print(median(t[i][0], t[i][1]))


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	c = a // 2 + 1
	if a // 2 > b:
		print(0)
		continue
	val = b // c
	print(val)


import sys
input = lambda : sys.stdin.readline()[:-1]
for _ in range(int(input())):
	(n, s) = map(int, input().split())
	sys.stdout.write(f'{s // (n // 2 + 1)}\n')


from __future__ import division, print_function
import os
import sys
from io import BytesIO, IOBase
import math
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

def main():

	def solve():
		(n, s) = map(int, input().split())
		if n == 1:
			return s
		if n // 2 > s:
			return 0
		if n & 1:
			median = math.ceil(n / 2)
		else:
			median = n // 2 + 1
		x = s // median
		return x
	t = int(input())
	for i in range(t):
		print(solve())
BUFSIZE = 8192

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')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


t = int(input())
for _ in range(t):
	(n, s) = map(int, input().split())
	m = n // 2 + 1
	ans = s // m
	print(ans)


import sys
input = sys.stdin.readline

def inp():
	return int(input())

def input_list():
	return list(map(int, input().split()))

def input_string():
	s = input()
	return list(s[:len(s) - 1])

def input_int_gen():
	return map(int, input().split())
tests = inp()
for _ in range(tests):
	(s, n) = input_int_gen()
	m = s // 2 + 1
	k = n % m
	print(n // m)


t = int(input())
result_holder = list()
for test in range(t):
	(n, s) = map(int, input().split())
	m = n // 2 + 1
	result_holder.append(s // m)
for num in result_holder:
	print(num)


import math
t = int(input())
for i in range(t):
	(n, s) = map(int, input().split())
	indx = math.ceil(n / 2)
	after = n - indx + 1
	if after > s:
		print('0')
	else:
		print(s // after)


import sys, os.path, math
if os.path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
for t in range(int(input())):
	(n, s) = list(map(int, input().split()))
	val = n // 2 + 1
	if s < val:
		print(0)
	else:
		print(int(math.floor(s / val)))


from math import ceil
for _ in range(int(input())):
	(n, s) = map(int, input().split())
	remove = ceil(n / 2) - 1
	n = n - remove
	print(s // n)


for _ in range(int(input())):
	(n, s) = map(int, input().split())
	a = 0
	b = n // 2
	b += 1
	a = s // b
	print(a)


from sys import stdin, stdout
ip = lambda : stdin.readline().rstrip('\r\n')
ips = lambda : ip().split()
out = lambda x, end='\n': stdout.write(str(x) + end)
for _ in range(int(ip())):
	(n, s) = map(int, ips())
	if n & 1:
		x = n // 2
		out(s // (n - x))
	else:
		x = n // 2 - 1
		out(s // (n - x))


import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(10 ** 8)
INF = 10 ** 9 + 5

def judge(a, N, S):
	if a * (N // 2 + 1) <= S:
		return 1
	else:
		return 0

def meguru_bisearch(ng, ok, N, S):
	while abs(ok - ng) > 1:
		mid = (ok + ng) // 2
		if judge(mid, N, S):
			ok = mid
		else:
			ng = mid
	return ok

def solve():
	(N, S) = map(int, input().split())
	ans = meguru_bisearch(INF, 0, N, S)
	print(ans)
	return
T = int(input())
for i in range(1, T + 1):
	solve()


import math

def GetInpOfTest():
	(n, s) = map(int, input().split())
	return (n, s)

def SolOfTest(n, s):
	mid_ind = int(math.ceil(n / 2)) - 1
	num_els_gr_or_eq_mid = n - mid_ind
	mid = s // num_els_gr_or_eq_mid
	return mid
num_tests = int(input())
answers = []
for test_ind in range(num_tests):
	(n, s) = GetInpOfTest()
	mid = SolOfTest(n, s)
	answers.append(mid)
for answ in answers:
	print(answ)


t = int(input())
for i in range(t):
	(n, s) = map(int, input().split())
	if n == 1:
		ans = s
	if n == 2:
		ans = s // 2
	if n > 2:
		a = n // 2
		ans = s // (a + 1)
	print(ans)


t = int(input())
for i in range(t):
	(n, s) = (int(x) for x in input().split())
	print(s // (n // 2 + 1))


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	(n, s) = map(int, input().split())
	print(s // ((n + 2) // 2))


times = int(input())
while times != 0:
	times -= 1
	inputx = input().split()
	n = int(inputx[0])
	s = int(inputx[1])
	result = s // (n // 2 + 1)
	print(result)


import math
import heapq
import string
from collections import deque
from bisect import bisect, bisect_left, bisect_right, insort
import sys
input = sys.stdin.readline
S = lambda : input().rstrip()
I = lambda : int(S())
M = lambda : map(int, S().split())
L = lambda : list(M())
H = 1000000000 + 7
for _ in range(I()):
	(n, s) = M()
	n1 = math.ceil(n / 2)
	n1 = n - n1 + 1
	print(s // n1)


import queue
from math import *
import sys
from collections import *
from random import *
from itertools import *
sys.setrecursionlimit(99999)
eps = sys.float_info.epsilon
P = 2
INF = 1000000000.0 + 1
MOD = 1000000007

def is_prime(n):
	if n == 0 or n == 1:
		return False
	d = 2
	while d * d <= n:
		if n % d == 0:
			return False
		d += 1
	return True

def div_up(n, k):
	if n % k == 0:
		return n // k
	else:
		return n // k + 1

def num_len(n, base=10):
	if n == 0:
		return 1
	return int(floor(log(n, base) + 1))

def dfs_sample(graph, cl, p, v):
	cl[v] = 1
	for to in graph[v]:
		if cl[to] == 1 and p[v] != to:
			pass
		elif cl[to] == 0:
			p[to] = v
			dfs_sample(graph, cl, p, to)
	cl[v] = 2

def down(a):
	for i in range(1, len(a)):
		if a[i] > a[i - 1]:
			return False
	return True

def up(a):
	for i in range(1, len(a)):
		if a[i] < a[i - 1]:
			return False
	return True

def code(c):
	return ord(c) - 32

def _hash_(s):
	(res, p) = (0, 1)
	for i in range(len(s)):
		res += code(s[i]) * p
		res %= MOD
		p *= P
		p %= MOD
	return res % MOD

def remove_edge(v, u, graph):
	graph[v].remove(u)
	graph[u].remove(v)
b = True

def dfs_stack(start, graph, visited, flags):
	global b
	stack = []
	visited[start] = True
	stack.append(start)
	while len(stack) != 0:
		v = stack.pop()
		if not flags[v]:
			b = False
		for to in graph[v]:
			if not visited[to]:
				visited[to] = True
				stack.append(to)

def all_eq(a):
	for i in range(len(a) - 1):
		if a[i] != a[i + 1]:
			return False
	return True

def solve():
	(n, s) = map(int, input().split())
	if n == 1:
		print(s)
	elif n % 2 != 0:
		print(2 * s // (n + 1))
	else:
		print(2 * s // (n + 2))
for _ in range(int(input())):
	solve()

def debug():
	pass


import sys
input = lambda : sys.stdin.readline().rstrip('\r\n')
inp_vars_int = lambda : map(int, input().split())
inp_list_int = lambda : list(map(int, input().split()))
t = int(input())
for _ in range(t):
	(n, s) = inp_vars_int()
	n_medover = n // 2 + 1
	res = s // n_medover
	print(res)


from math import floor, ceil

def sol():
	(n, s) = map(int, input().split())
	print(floor(s / (n - ceil(n / 2) + 1)))
for i in range(int(input())):
	sol()


import math
testcases = int(input())
for i in range(testcases):
	(n, s) = map(int, input().split())
	z = n // 2 + 1
	print(s // z)


from collections import Counter
from itertools import accumulate, product, groupby
import operator
import math
from functools import reduce

def solve():
	(n, total) = [int(char) for char in input().split()]
	half_pos = math.ceil(n / 2) - 1
	slots_left = n - half_pos
	return math.floor(total / slots_left)
for _ in range(int(input())):
	print(solve())


import sys
import math
input = sys.stdin.read()
input = input.strip().split('\n')
for line in input[1:]:
	test = line.split(' ')
	length = int(test[0])
	totalsum = int(test[1])
	med_index = math.ceil(length / 2)
	zeros = med_index - 1
	median = totalsum // (length - zeros)
	print(median)


from collections import deque, Counter
from collections import defaultdict as dfd
from bisect import bisect, bisect_left
from math import sqrt, gcd, ceil, factorial, log2
from heapq import heapify, heappush, heappop
MOD = 10 ** 9 + 7
inf = float('inf')
ans_ = []

def nin():
	return int(input())

def ninf():
	return int(file.readline())

def st():
	return input().strip()

def stf():
	return file.readline().strip()

def read():
	return list(map(int, input().strip().split()))

def readf():
	return list(map(int, file.readline().strip().split()))

def readfl():
	return list(map(float, input().strip().split()))

def readffl():
	return list(map(float, file.readline().strip().split()))

def solve():
	for _ in range(nin()):
		(n, s) = read()
		if n == 1:
			ans_.append(s)
		elif n == 2:
			ans_.append(s // 2)
		else:
			t = ceil(n / 2) + [1, 0][n % 2]
			ans_.append(s // t)
solve()
for i in ans_:
	print(i)


t = int(input())
for i in range(t):
	(n, s) = (int(i) for i in input().split(' '))
	if n % 2 == 1:
		n -= n // 2
	else:
		n -= n // 2 - 1
	print(s // n)


a = int(input())
for i in range(a):
	(m, s) = input().split()
	m = int(m)
	s = int(s)
	print(int(s / (m // 2 + 1)))


from sys import stdin
for testcase in range(int(stdin.readline())):
	(length, summation) = map(int, stdin.readline().split())
	medianIndex0Based = (length - 1) // 2
	nonSkippableElements = length - medianIndex0Based
	print(summation // nonSkippableElements)


for _ in range(int(input())):
	(n, s) = map(int, input().split())
	if n == 1:
		print(s)
	else:
		if n % 2 == 0:
			x = int(n / 2) - 1
		else:
			x = int(n / 2)
		i = 1
		n = n - x
		print(int(s / n))


for _ in range(int(input())):
	(n, s) = map(int, input().split())
	if n == 1:
		print(s)
	elif n % 2 != 0:
		n = n // 2 + 1
		s = s // n
		print(s)
	else:
		s = s // (n // 2 + 1)
		print(s)


import sys
from sys import stdin
t = int(stdin.readline())
for i in range(t):
	(n, s) = map(int, stdin.readline().split())
	ans = s // (n - (n - 1) // 2)
	print(ans)


from math import ceil
t = int(input())
for i in range(t):
	(n, s) = input().split()
	n = int(n)
	s = int(s)
	if n & 1:
		print(s // ceil(n / 2))
	else:
		print(s // (n // 2 + 1))


import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	(n, s) = map(int, input().split())
	if n % 2:
		print(s // ((n + 1) // 2))
	else:
		print(s // (n // 2 + 1))


import math
t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	a = a // 2 + 1
	print(b // a)


import math

def median(list):
	n = list[0]
	summation = list[1]
	if n % 2 == 0:
		med = summation / (n / 2 + 1)
	elif n % 2 != 0:
		med = summation / ((n + 1) / 2)
	med = int(med)
	return med
t = int(input())
int_list_2D = []
for i in range(t):
	int_list = []
	(n, summation) = input().split()
	n = int(n)
	summation = int(summation)
	int_list.append(n)
	int_list.append(summation)
	int_list_2D.append(int_list)
for x in int_list_2D:
	y = median(x)
	print(y)


for _ in range(int(input())):
	(n, s) = map(int, input().split())
	k = n // 2
	if n % 2 != 0:
		k += 1
	if s >= k:
		q = n // 2
		q += 1
		print(s // q)
	else:
		print('0')


t = int(input().strip())
for z in range(t):
	tmp = input().split(' ')
	n = int(tmp[0])
	s = int(tmp[1])
	mid = int((n + 1) / 2)
	ans = int(s / (n - mid + 1))
	print(ans)


import math
import sys
import collections
import bisect
import time
import random
import itertools
import string
from collections import Counter, defaultdict

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def get_list():
	return list(map(int, sys.stdin.readline().strip().split()))

def get_string():
	return sys.stdin.readline().strip()
for t in range(int(input())):
	(n, s) = get_ints()
	if n == 1:
		print(s)
		continue
	elif n == 2:
		print(s // 2)
		continue
	ele_included = math.ceil(n / 2)
	if n % 2 == 0:
		ele_included += 1
	print(s // ele_included)


import math
t = int(input())
for _ in range(t):
	(n, s) = map(int, input().split())
	m = math.ceil(n / 2)
	if m == 1:
		if n == 1:
			print(s)
			continue
		print(int(s / 2))
		continue
	print(int(s / (n - m + 1)))


def function():
	array = []
	(n, sum) = input().split()
	n = int(n)
	sum = int(sum)
	print(sum // (n // 2 + 1))
i = input()
for j in range(int(i)):
	function()


from collections import defaultdict
import math
NO = 'NO'
YES = 'YES'
MOD = 1000000007
ALPH = 'abcdefghijklmnopqrstuvwxyz'

def input_int():
	return int(input())

def input_list():
	return input().split(' ')

def input_list_int():
	return list(map(int, input_list()))

def list_int_to_str(a, sep=' '):
	return sep.join((str(x) for x in a))
global_ans = []

def pr(a):
	global_ans.append(a)

def z_func(s):
	n = len(s)
	z = [0] * n
	l = r = 0
	for i in range(1, n):
		if r >= i:
			z[i] = min(z[i - l], r - i + 1)
		while z[i] + i < n and s[z[i]] == s[z[i] + i]:
			z[i] += 1
		if i + z[i] - 1 > r:
			l = i
			r = i + z[i] - 1
	return z

def is_prime(n):
	d = 2
	while n % d != 0:
		d += 1
	return d == n

def solve():
	(n, s) = input_list_int()
	t = math.ceil(n / 2) - 1
	ans = s // (n - t)
	pr(max(0, ans))
query_count = 1
query_count = input_int()
while query_count:
	query_count -= 1
	solve()
for global_ans_line in global_ans:
	print(global_ans_line)


for _ in range(int(input())):
	(n, c) = map(int, input().split())
	print(c // ((n >> 1) + 1))


def parse_n_solve():
	t = int(input())
	for i in range(t):
		(n, s) = map(int, input().split())
		print(s // (n // 2 + 1))
parse_n_solve()


import math
num_values = input('')
num_values = int(num_values)
tot_values = []
for value in range(num_values):
	n_s = input('')
	values_split = n_s.split(' ')
	tot_values.append([int(y) for y in values_split])
for (i, value_list) in enumerate(tot_values):
	if value_list[0] % 2 == 0:
		middle_number = value_list[0] / 2
		tot_num_consider = middle_number + 1
	else:
		middle_number = (value_list[0] + 1) / 2
		tot_num_consider = middle_number
	median_val = math.floor(value_list[1] / tot_num_consider)
	print(median_val)


import math
t = int(input())
for i in range(t):
	(n, s) = map(int, input().split())
	if n == 1:
		print(s)
	elif n == 2:
		print(math.floor(s / n))
	elif n % 2 == 0:
		print(math.floor(s / (1 + n / 2)))
	else:
		print(math.floor(s / math.ceil(n / 2)))


all = eval(input())
for i in range(all):
	(n, s) = map(int, input().split())
	n = n - n // 2 + 1 if n % 2 == 0 else n - n // 2
	print(s // n)


import math
for i in range(int(input())):
	(n, s) = map(int, input().split())
	k = math.floor((n + 2) / 2)
	print(math.floor(s / k))


import sys
input = sys.stdin.readline
from collections import deque
from itertools import combinations
t = int(input())
for i in range(t):
	(n, s) = list(map(int, input().split()))
	if n == 1:
		print(s)
	else:
		if n % 2 == 0:
			m = n // 2 - 1
		else:
			m = n // 2
		print(s // (n - m))


import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	count = n // 2 + 1
	print(k // count)


get_index = lambda len_array: round(len_array / 2 + 0.1) - 1
inten = lambda x: int(x)
for i in range(int(input())):
	(len_array, points) = map(inten, input().split(' '))
	index = get_index(len_array)
	print(int(points / (len_array - index)))


t = int(input())
for i in range(0, t):
	(n, s) = map(int, input().split())
	if n % 2 == 0:
		a = n / 2 - 1
	if n % 2 != 0:
		a = (n + 1) / 2 - 1
	b = n - a
	c = int(s / b)
	print(c)


test = int(input())
for case in range(test):
	(a, b) = input().split()
	a = int(a)
	b = int(b)
	if a % 2 == 1:
		y = 2 * b / (a + 1)
	else:
		y = b / (a / 2 + 1)
	print(int(y))


import sys

def input():
	return sys.stdin.readline().rstrip('\r\n')

def maps():
	return [int(i) for i in input().split()]
from math import ceil
for i in range(*maps()):
	(a, b) = maps()
	if a == 1:
		print(b)
		continue
	x = b // (a // 2 + 1)
	print(x)


import math
import random
import heapq, bisect
import sys
from collections import deque, defaultdict
from fractions import Fraction
import sys
from collections import defaultdict
mod = 10 ** 9 + 7
mod1 = 998244353
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

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')

class TreeNode:

	def __init__(self, k, v):
		self.key = k
		self.value = v
		self.left = None
		self.right = None
		self.parent = None
		self.height = 1
		self.num_left = 1
		self.num_total = 1

class AvlTree:

	def __init__(self):
		self._tree = None

	def add(self, k, v):
		if not self._tree:
			self._tree = TreeNode(k, v)
			return
		node = self._add(k, v)
		if node:
			self._rebalance(node)

	def _add(self, k, v):
		node = self._tree
		while node:
			if k < node.key:
				if node.left:
					node = node.left
				else:
					node.left = TreeNode(k, v)
					node.left.parent = node
					return node.left
			elif node.key < k:
				if node.right:
					node = node.right
				else:
					node.right = TreeNode(k, v)
					node.right.parent = node
					return node.right
			else:
				node.value = v
				return

	@staticmethod
	def get_height(x):
		return x.height if x else 0

	@staticmethod
	def get_num_total(x):
		return x.num_total if x else 0

	def _rebalance(self, node):
		n = node
		while n:
			lh = self.get_height(n.left)
			rh = self.get_height(n.right)
			n.height = max(lh, rh) + 1
			balance_factor = lh - rh
			n.num_total = 1 + self.get_num_total(n.left) + self.get_num_total(n.right)
			n.num_left = 1 + self.get_num_total(n.left)
			if balance_factor > 1:
				if self.get_height(n.left.left) < self.get_height(n.left.right):
					self._rotate_left(n.left)
				self._rotate_right(n)
			elif balance_factor < -1:
				if self.get_height(n.right.right) < self.get_height(n.right.left):
					self._rotate_right(n.right)
				self._rotate_left(n)
			else:
				n = n.parent

	def _remove_one(self, node):
		replacement = node.left or node.right
		if node.parent:
			if AvlTree._is_left(node):
				node.parent.left = replacement
			else:
				node.parent.right = replacement
			replacement.parent = node.parent
			node.parent = None
		else:
			self._tree = replacement
			replacement.parent = None
		node.left = None
		node.right = None
		node.parent = None
		self._rebalance(replacement)

	def _remove_leaf(self, node):
		if node.parent:
			if AvlTree._is_left(node):
				node.parent.left = None
			else:
				node.parent.right = None
			self._rebalance(node.parent)
		else:
			self._tree = None
		node.parent = None
		node.left = None
		node.right = None

	def remove(self, k):
		node = self._get_node(k)
		if not node:
			return
		if AvlTree._is_leaf(node):
			self._remove_leaf(node)
			return
		if node.left and node.right:
			nxt = AvlTree._get_next(node)
			node.key = nxt.key
			node.value = nxt.value
			if self._is_leaf(nxt):
				self._remove_leaf(nxt)
			else:
				self._remove_one(nxt)
			self._rebalance(node)
		else:
			self._remove_one(node)

	def get(self, k):
		node = self._get_node(k)
		return node.value if node else -1

	def _get_node(self, k):
		if not self._tree:
			return None
		node = self._tree
		while node:
			if k < node.key:
				node = node.left
			elif node.key < k:
				node = node.right
			else:
				return node
		return None

	def get_at(self, pos):
		x = pos + 1
		node = self._tree
		while node:
			if x < node.num_left:
				node = node.left
			elif node.num_left < x:
				x -= node.num_left
				node = node.right
			else:
				return (node.key, node.value)
		raise IndexError('Out of ranges')

	@staticmethod
	def _is_left(node):
		return node.parent.left and node.parent.left == node

	@staticmethod
	def _is_leaf(node):
		return node.left is None and node.right is None

	def _rotate_right(self, node):
		if not node.parent:
			self._tree = node.left
			node.left.parent = None
		elif AvlTree._is_left(node):
			node.parent.left = node.left
			node.left.parent = node.parent
		else:
			node.parent.right = node.left
			node.left.parent = node.parent
		bk = node.left.right
		node.left.right = node
		node.parent = node.left
		node.left = bk
		if bk:
			bk.parent = node
		node.height = max(self.get_height(node.left), self.get_height(node.right)) + 1
		node.num_total = 1 + self.get_num_total(node.left) + self.get_num_total(node.right)
		node.num_left = 1 + self.get_num_total(node.left)

	def _rotate_left(self, node):
		if not node.parent:
			self._tree = node.right
			node.right.parent = None
		elif AvlTree._is_left(node):
			node.parent.left = node.right
			node.right.parent = node.parent
		else:
			node.parent.right = node.right
			node.right.parent = node.parent
		bk = node.right.left
		node.right.left = node
		node.parent = node.right
		node.right = bk
		if bk:
			bk.parent = node
		node.height = max(self.get_height(node.left), self.get_height(node.right)) + 1
		node.num_total = 1 + self.get_num_total(node.left) + self.get_num_total(node.right)
		node.num_left = 1 + self.get_num_total(node.left)

	@staticmethod
	def _get_next(node):
		if not node.right:
			return node.parent
		n = node.right
		while n.left:
			n = n.left
		return n

class SegmentTree1:

	def __init__(self, data, default=2 ** 51, func=lambda a, b: a & b):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)

class SegmentTree:

	def __init__(self, data, default=0, func=lambda a, b: a + b):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)

class Factorial:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorials = [1, 1]
		self.invModulos = [0, 1]
		self.invFactorial_ = [1, 1]

	def calc(self, n):
		if n <= -1:
			print('Invalid argument to calculate n!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.factorials):
			return self.factorials[n]
		nextArr = [0] * (n + 1 - len(self.factorials))
		initialI = len(self.factorials)
		prev = self.factorials[-1]
		m = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * i % m
		self.factorials += nextArr
		return self.factorials[n]

	def inv(self, n):
		if n <= -1:
			print('Invalid argument to calculate n^(-1)')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		p = self.MOD
		pi = n % p
		if pi < len(self.invModulos):
			return self.invModulos[pi]
		nextArr = [0] * (n + 1 - len(self.invModulos))
		initialI = len(self.invModulos)
		for i in range(initialI, min(p, n + 1)):
			next = -self.invModulos[p % i] * (p // i) % p
			self.invModulos.append(next)
		return self.invModulos[pi]

	def invFactorial(self, n):
		if n <= -1:
			print('Invalid argument to calculate (n^(-1))!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.invFactorial_):
			return self.invFactorial_[n]
		self.inv(n)
		nextArr = [0] * (n + 1 - len(self.invFactorial_))
		initialI = len(self.invFactorial_)
		prev = self.invFactorial_[-1]
		p = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * self.invModulos[i % p] % p
		self.invFactorial_ += nextArr
		return self.invFactorial_[n]

class Combination:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorial = Factorial(MOD)

	def ncr(self, n, k):
		if k < 0 or n < k:
			return 0
		k = min(k, n - k)
		f = self.factorial
		return f.calc(n) * f.invFactorial(max(n - k, k)) * f.invFactorial(min(k, n - k)) % self.MOD

def powm(a, n, m):
	if a == 1 or n == 0:
		return 1
	if n % 2 == 0:
		s = powm(a, n // 2, m)
		return s * s % m
	else:
		return a * powm(a, n - 1, m) % m

def sort_list(list1, list2):
	zipped_pairs = zip(list2, list1)
	z = [x for (_, x) in sorted(zipped_pairs)]
	return z

def product(l):
	por = 1
	for i in range(len(l)):
		por *= l[i]
	return por

def binarySearchCount(arr, n, key):
	left = 0
	right = n - 1
	count = 0
	while left <= right:
		mid = int((right + left) / 2)
		if arr[mid] <= key:
			count = mid + 1
			left = mid + 1
		else:
			right = mid - 1
	return count

def countdig(n):
	c = 0
	while n > 0:
		n //= 10
		c += 1
	return c

def binary(x, length):
	y = bin(x)[2:]
	return y if len(y) >= length else '0' * (length - len(y)) + y

def countGreater(arr, n, k):
	l = 0
	r = n - 1
	leftGreater = n
	while l <= r:
		m = int(l + (r - l) / 2)
		if arr[m] >= k:
			leftGreater = m
			r = m - 1
		else:
			l = m + 1
	return n - leftGreater
for ik in range(int(input())):
	(n, s) = map(int, input().split())
	n -= (n - 1) // 2
	print(s // n)


for _ in range(int(input())):
	(a, b) = list(map(int, input().split()))
	if a == 1:
		print(b)
		continue
	a = a // 2 + 1
	print(b // a)


from collections import deque
import heapq
from math import sqrt
import operator
from operator import itemgetter
import sys
import copy
inf_var = 0
if inf_var == 1:
	inf = open('input.txt', 'r')
else:
	inf = sys.stdin
input = inf.readline

def read_one_int():
	return int(input().rstrip('\n'))

def read_one_float():
	return float(input().rstrip('\n'))

def read_list_of_ints():
	res = [int(val) for val in input().rstrip('\n').split(' ')]
	return res

def read_str():
	return input().rstrip()

def main():
	tests = read_one_int()
	for _ in range(tests):
		(n, s) = read_list_of_ints()
		p = (n + 1) // 2
		cnt = n - p + 1
		res = s // cnt
		print(res)
main()


import sys
for _ in range(int(sys.stdin.readline())):
	(n, s) = [int(i) for i in sys.stdin.readline().split()]
	sys.stdout.write(str(s // (n // 2 + 1)) + '\n')


for j in range(int(input())):
	d = input().split(' ')
	print(int(d[1]) // (int(d[0]) // 2 + 1))


k = []
for _ in range(int(input())):
	(n, s) = map(int, input().split())
	k.append(s // (n // 2 + 1))
for i in k:
	print(i)


import math
import statistics
testcase = int(input())
for _ in range(testcase):
	(n, s) = map(int, input().split())
	if n == 1:
		print(s)
	elif n == 2:
		print(math.floor(s / n))
	elif n % 2 == 0:
		print(math.floor(s / (n / 2 + 1)))
	else:
		print(math.floor(s / math.ceil(n / 2)))


import os, sys
from io import BytesIO, IOBase

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, 8192))
			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, 8192))
			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')

class dict(dict):

	def __missing__(self, key):
		return 0
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
inp = lambda dtype: [dtype(x) for x in input().split()]
inp_2d = lambda dtype, n: [dtype(input()) for _ in range(n)]
inp_2ds = lambda dtype, n: [inp(dtype) for _ in range(n)]
inp_enu = lambda dtype: [(i, x) for (i, x) in enumerate(inp(dtype))]
inp_enus = lambda dtype, n: [[i] + inp(dtype) for i in range(n)]
ceil1 = lambda a, b: (a + b - 1) // b
for _ in range(int(input())):
	(n, s) = inp(int)
	med = ceil1(n, 2)
	(be, en) = (0, s)
	while be < en:
		md = be + en + 1 >> 1
		if md * (n - med + 1) <= s:
			be = md
		else:
			en = md - 1
	print(be)


import math

def medianMaximization(n, s):
	return s // (n - math.ceil(n / 2) + 1)
for _ in range(int(input())):
	(n, s) = list(map(int, input().split()))
	print(medianMaximization(n, s))


number = int(input())
b = list()
for i in range(number):
	a = input().split()
	a = [int(j) for j in a]
	indice_medio = a[0] // 2
	if a[0] % 2 == 0:
		indice_range = a[0] - indice_medio + 1
	elif a[0] % 2 == 1:
		indice_range = a[0] - indice_medio
	mediana = a[1] // indice_range
	b.append(mediana)
for k in b:
	print(k)


t = int(input())
for i in range(t):
	n = list(map(int, input().split()))
	if n[0] == 2:
		print(n[1] // n[0])
	elif n[0] == 1:
		print(n[1])
	elif n[0] % 2 == 0:
		print(n[1] // (n[0] - (n[0] // 2 - 1)))
	else:
		print(n[1] // (n[0] - n[0] // 2))


import sys

def input():
	return sys.stdin.readline().rstrip('\r\n')

def maps():
	return [int(i) for i in input().split()]
from math import ceil
for i in range(*maps()):
	(n, s) = maps()
	if n == 1:
		print(s)
		continue
	if s == n:
		print(1)
		continue
	m = ceil(n / 2) + (1 if n % 2 == 0 else 0)
	print(s // m)


num_test = int(input())
results = []
for i in range(num_test):
	(n, s) = map(int, input().split())
	if n % 2 == 0:
		mid = n // 2
	else:
		mid = n // 2 + 1
	x = s / (n - mid + 1)
	x = int(x)
	results.append(x)
for x in results:
	print(x)


for i in [*open(0)][1:]:
	(n, m) = map(int, i.split())
	print(m // (n // 2 + 1))


import math
w = int(input())
l = []
for i in range(w):
	t = list(map(int, input().split()))
	l.append(t)
for i in l:
	r = math.ceil(i[0] / 2)
	k = i[0] - r + 1
	if k == 0:
		print(0)
	else:
		print(math.floor(i[1] / k))


t = int(input())
for _ in range(t):
	ns = input()
	(n, s) = [int(i) for i in ns.split(' ')]
	m = (n + 1) // 2
	o = n - m + 1
	r = s // o
	print(r)


from math import ceil
t = int(input())
out = ''
while t > 0:
	(n, s) = map(int, input().split())
	out += str(s // ceil((n + 1) / 2)) + '\n'
	t -= 1
print(out[:-1])


t = int(input())
for test in range(t):
	(n, s) = map(int, input().split())
	m = n // 2 + 1
	print(s // m)


import math
n = int(input())
for i in range(n):
	(n, s) = map(int, input().split())
	x = math.ceil(n / 2)
	kol = n - x + 1
	print(s // kol)


import sys
import math
t = int(sys.stdin.readline())
for line in sys.stdin:
	(n, s) = [int(x) for x in line.split(' ')]
	n = int(n // 2 + 1)
	print(int(math.floor(s / n)))


from math import ceil
t = int(input())
lengths = [None] * t
sums = [None] * t
for i in range(t):
	(lengths[i], sums[i]) = map(int, input().split())
for i in range(t):
	print(sums[i] // (lengths[i] - ceil(lengths[i] / 2) + 1))


import math

def func(n, s):
	median_num = math.ceil(n / 2)
	if n % 2 != 0:
		return s // median_num
	return s // (median_num + 1)
t = int(input())
for _ in range(t):
	(n, s) = map(int, input().split())
	print(func(n, s))


mod = 1000000007
from math import factorial, ceil, pow, sqrt, floor
from sys import stdin, stdout
from collections import defaultdict, Counter, deque
for _ in range(int(stdin.readline())):
	(n, s) = map(int, stdin.readline().split())
	if n == 1:
		print(s)
	else:
		r = n - (n - 1) // 2
		print(s // r)


import math
t = int(input())
for i in range(t):
	ns = list(map(int, input().split()))
	n = ns[0]
	s = ns[1]
	if n % 2 == 0:
		fac = n / 2 + 1
		med = int(s // fac)
	else:
		fac = math.ceil(n / 2)
		med = int(s // fac)
	print(med)


from sys import stdin, setrecursionlimit, maxsize
from collections import deque
from heapq import *
from math import sqrt, gcd, ceil
input = stdin.readline
setrecursionlimit(10 ** 5)

def solution(n, s):
	if n == 1:
		return s
	n2 = n // 2 + 1
	return s // n2
for _ in range(int(input())):
	(p, q) = map(int, input().split())
	print(solution(p, q))


import os
import sys
from io import BytesIO, IOBase
import math
from queue import Queue
import collections
import itertools
import bisect
import heapq
import random

def main():
	pass
BUFSIZE = 8192

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')

def binary(n):
	return bin(n).replace('0b', '')

def decimal(s):
	return int(s, 2)

def pow2(n):
	p = 0
	while n > 1:
		n //= 2
		p += 1
	return p

def primeFactors(n):
	cnt = []
	while n % 2 == 0:
		cnt.append(2)
		n = n / 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			cnt.append(i)
			n = n / i
	if n > 2:
		cnt.append(int(n))
	return cnt

def primeFactorsCount(n):
	cnt = 0
	while n % 2 == 0:
		cnt += 1
		n = n // 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			cnt += 1
			n = n // i
	if n > 2:
		cnt += 1
	return cnt

def isPrime(n):
	if n == 1:
		return False
	else:
		root = int(n ** 0.5)
		root += 1
		for i in range(2, root):
			if n % i == 0:
				return False
		return True

def maxPrimeFactors(n):
	maxPrime = -1
	while n % 2 == 0:
		maxPrime = 2
		n >>= 1
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			maxPrime = i
			n = n / i
	if n > 2:
		maxPrime = n
	return int(maxPrime)

def countcon(s, i):
	c = 0
	ch = s[i]
	for i in range(i, len(s)):
		if s[i] == ch:
			c += 1
		else:
			break
	return c

def lis(arr):
	n = len(arr)
	lis = [1] * n
	for i in range(1, n):
		for j in range(0, i):
			if arr[i] > arr[j] and lis[i] < lis[j] + 1:
				lis[i] = lis[j] + 1
	maximum = 0
	for i in range(n):
		maximum = max(maximum, lis[i])
	return maximum

def isSubSequence(str1, str2):
	m = len(str1)
	n = len(str2)
	j = 0
	i = 0
	while j < m and i < n:
		if str1[j] == str2[i]:
			j = j + 1
		i = i + 1
	return j == m

def maxfac(n):
	root = int(n ** 0.5)
	for i in range(2, root + 1):
		if n % i == 0:
			return n // i
	return n

def p2(n):
	c = 0
	while n % 2 == 0:
		n //= 2
		c += 1
	return c

def seive(n):
	primes = [True] * (n + 1)
	primes[1] = primes[0] = False
	i = 2
	while i * i <= n:
		if primes[i] == True:
			for j in range(i * i, n + 1, i):
				primes[j] = False
		i += 1
	pr = []
	for i in range(0, n + 1):
		if primes[i]:
			pr.append(i)
	return pr

def ncr(n, r, p):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % p
		den = den * (i + 1) % p
	return num * pow(den, p - 2, p) % p

def denofactinverse(n, m):
	fac = 1
	for i in range(1, n + 1):
		fac = fac * i % m
	return pow(fac, m - 2, m)

def numofact(n, m):
	fac = 1
	for i in range(1, n + 1):
		fac = fac * i % m
	return fac

def sod(n):
	s = 0
	while n > 0:
		s += n % 10
		n //= 10
	return s

def inv(n, m):
	return pow(n, m - 2, m)
for xyz in range(0, int(input())):
	(n, s) = map(int, input().split())
	nos = (n + 1) // 2 + (1 - n % 2)
	print(s // nos)


n = int(input())
t = []
for i in range(n):
	(a, b) = map(int, input().split())
	w = a // 2 + 1
	k = b // w
	t.append(k)
for y in t:
	print(y)


import sys
input = lambda : sys.stdin.readline().strip()

def solve():
	(n, s) = map(int, input().split())
	L = (n + 1) // 2 if n & 1 else n // 2 + 1
	return s // L
for _ in range(int(input())):
	print(solve())


import math
for _ in range(int(input())):
	(n, s) = map(int, input().split())
	x = math.ceil(n / 2)
	if n == 1:
		print(s)
	else:
		m = s // (n - x + 1)
		print(m)


for i in range(int(input())):
	(n, m) = map(int, input().split())
	n = n // 2 + 1
	print(m // n)


import math
for _ in range(int(input())):
	(n, s) = map(int, input().split())
	print(s // ((n + 2) // 2))


t = eval(input())
n = []
s = []
for i in range(t):
	(a, b) = map(int, input().split(' '))
	n.append(a)
	s.append(b)
for i in range(t):
	if n[i] == 1:
		print(s[i])
	elif n[i] % 2 == 0:
		print(s[i] // (n[i] - n[i] // 2 + 1))
	elif n[i] % 2 == 1:
		print(s[i] // (n[i] - n[i] // 2))


t = int(input())
for _ in range(1, t + 1):
	(a, b) = map(int, input().split())
	n = a // 2 + 1
	print(b // n)


l = int(input())
for i in range(l):
	(n, s) = map(int, input().split())
	print(s // (n // 2 + 1))


import math
for _ in range(int(input())):
	(n, s) = map(int, input().split())
	try:
		temp = math.ceil(n / 2) - 1
		print(s // (n - temp))
	except:
		pass


t = int(input())
for i in range(t):
	s = input()
	n = int(s[:s.find(' ')])
	sum = int(s[s.find(' ') + 1:])
	print(sum // (n // 2 + 1))


from sys import stdin
input = stdin.readline
rn = lambda : int(input())
rns = lambda : map(int, input().split())
rl = lambda : list(map(int, input().split()))
rs = lambda : input().strip()
YN = lambda x: print('YES') if x else print('NO')
mod = 10 ** 9 + 7
from math import ceil
for _ in range(rn()):
	(n, s) = rns()
	if n % 2:
		print(s // ceil(n / 2))
	else:
		print(s // (n // 2 + 1))


from sys import stdin
from collections import defaultdict
from bisect import insort, bisect_left
from math import ceil
from itertools import permutations
for _ in range(int(stdin.readline())):
	(n, s) = map(int, stdin.readline().split())
	ans = 0
	x = n // 2 + 1
	print(max(0, s // x))


for _ in range(int(input())):
	(n, s) = map(int, input().split())
	m = n // 2
	rem = n - m
	if n % 2 == 0:
		m -= 1
		rem += 1
	print(s // rem)


for s in [*open(0)][1:]:
	(n, s) = map(int, s.split())
	print(s // (n // 2 + 1))


import math
for _ in range(int(input())):
	(n, s) = map(int, input().split())
	ans = s // (n - math.ceil(n / 2) + 1)
	if n == 1:
		ans = s
	print(ans)


n = int(input())
for i in range(n):
	(a, b) = map(int, input().split())
	print(b // (a // 2 + 1))


import math
import os
import sys
from io import BytesIO, IOBase
from collections import Counter, deque
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())

def prog_name():
	(n, s) = getints()
	if n == 1:
		print(s)
	else:
		if n & 1:
			n -= n // 2
		else:
			n -= n // 2 - 1
		print(s // n)

def main():
	T = getint()
	for unique in range(T):
		prog_name()
main()


A = int(input())
for i in range(A):
	(n, s) = input().split()
	print(int(s) // (int(n) // 2 + 1))


def median_maximize(n, s):
	return s // (n // 2 + 1)
t = int(input())
for i in range(t):
	[n, s] = map(int, input().split())
	print(median_maximize(n, s))


import math
t = int(input(''))
for i in range(t):
	(n, s) = map(int, input('').split())
	m = math.ceil(n / 2) - 1
	n -= m
	print(s // n)


import math
import sys
import fractions
import itertools
wtf = sys.stdin.read()
wtf = wtf.strip().split('\n')
for t in wtf[1:]:
	(n, s) = map(int, t.split())
	m = n // 2 + 1
	print(s // m)


t = int(input())

def F(a, b):
	k = a // 2 + 1
	g = s // k
	return g
for i in range(t):
	(n, s) = map(int, input().split())
	print(F(n, s))


from math import ceil, floor
R = lambda : map(int, input().split())
(t,) = R()
for i in range(t):
	(n, s) = R()
	print(s // (n + 2 >> 1))


def median(n, s):
	m = n // 2 + 1
	return int(s // m)
n = int(input())
li1 = []
li2 = []
for i in range(0, n):
	a = input()
	b = a.split(' ')
	li1.append(int(b[0]))
	li2.append(int(b[1]))
for i in range(0, n):
	print(median(li1[i], li2[i]))


import math
for i in range(int(input())):
	(n, s) = map(int, input().split())
	num = math.ceil((n + 1) / 2)
	print(s // num)


import sys
import math
import bisect
from sys import stdin, stdout
from math import gcd, floor, sqrt, log2, ceil
from collections import defaultdict as dd
from bisect import bisect_left as bl, bisect_right as br
from bisect import insort
from collections import Counter
from collections import deque
from heapq import heappush, heappop, heapify
from itertools import permutations, combinations
from itertools import accumulate as ac
from random import randint as ri
mod = int(1000000000.0) + 7
mod = 998244353
ip = lambda : int(stdin.readline())
inp = lambda : map(int, stdin.readline().split())
ips = lambda : stdin.readline().rstrip()
out = lambda x: stdout.write(str(x) + '\n')
t = ip()
for _ in range(t):
	(n, s) = inp()
	ans = 0
	times = s // n
	if n & 1 == 0:
		med = n // 2 - 1
	else:
		med = n // 2
	left = times * med
	left += s % n
	ans = times
	ans += left // (n - med)
	print(ans)


t = int(input())
for i in range(0, t):
	(n, s) = map(int, input().split())
	c = 0
	c = s / (n - int((n - 1) / 2))
	print(int(c))


import math

def solve(n, s):
	p = n // 2 + 1
	s = math.floor(s / p)
	return s
t = int(input())
for i in range(t):
	(n, s) = map(int, input().split())
	ans = solve(n, s)
	print(ans)


import sys, math
from collections import deque, defaultdict
import operator as op
from functools import reduce
from itertools import permutations
import heapq
I = sys.stdin.readline
alpha = 'abcdefghijklmnopqrstuvwxyz'
mod = 10 ** 9 + 7

def ii():
	return int(I().strip())

def li():
	return list(map(int, I().strip().split()))

def mi():
	return map(int, I().strip().split())

def ncr(n, r):
	r = min(r, n - r)
	numer = reduce(op.mul, range(n, n - r, -1), 1)
	denom = reduce(op.mul, range(1, r + 1), 1)
	return numer // denom

def ispali(s):
	i = 0
	j = len(s) - 1
	while i < j:
		if s[i] != s[j]:
			return False
		i += 1
		j -= 1
	return True

def isPrime(n):
	if n <= 1:
		return False
	elif n <= 2:
		return True
	else:
		for i in range(2, int(n ** 0.5) + 1):
			if n % i == 0:
				return False
		return True

def cal(arr, x):
	n = len(arr)
	dp = [[-1 for i in range(x + 1)] for j in range(n + 1)]
	for i in range(n + 1):
		dp[i][0] = 0
	for i in range(1, n + 1):
		for j in range(1, x + 1):
			if j >= arr[i - 1] and dp[i - 1][j - arr[i - 1]] != -1:
				dp[i][j] = dp[i - 1][j] + dp[i - 1][j - arr[i - 1]]
			else:
				dp[i][j] = dp[i - 1][j]
	return dp[n][x]

def main():
	ans = ''
	for _ in range(ii()):
		(n, s) = mi()
		if n == 1:
			print(s)
		elif n == 1:
			print(s)
		else:
			x = math.ceil(n / 2)
			print(math.floor(s / (n - x + 1)))
main()


from __future__ import division, print_function
import os, sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip
from bisect import bisect_left as lower_bound, bisect_right as upper_bound

def so():
	return int(input())

def st():
	return input()

def mj():
	return map(int, input().strip().split(' '))

def msj():
	return map(str, input().strip().split(' '))

def le():
	return list(map(int, input().split()))

def lebe():
	return list(map(int, input()))

def dmain():
	sys.setrecursionlimit(1000000)
	threading.stack_size(1024000)
	thread = threading.Thread(target=main)
	thread.start()

def joro(L):
	return ''.join(map(str, L))

def decimalToBinary(n):
	return bin(n).replace('0b', '')

def isprime(n):
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			return False
	return True

def npr(n, r):
	return factorial(n) // factorial(n - r) if n >= r else 0

def ncr(n, r):
	return factorial(n) // (factorial(r) * factorial(n - r)) if n >= r else 0

def lower_bound(li, num):
	answer = -1
	start = 0
	end = len(li) - 1
	while start <= end:
		middle = (end + start) // 2
		if li[middle] >= num:
			answer = middle
			end = middle - 1
		else:
			start = middle + 1
	return answer

def upper_bound(li, num):
	answer = -1
	start = 0
	end = len(li) - 1
	while start <= end:
		middle = (end + start) // 2
		if li[middle] <= num:
			answer = middle
			start = middle + 1
		else:
			end = middle - 1
	return answer

def tir(a, b, c):
	if 0 == c:
		return 1
	if len(a) <= b:
		return 0
	if c != -1:
		return tir(a, 1 + b, c + a[b]) or tir(a, b + 1, c - a[b]) or tir(a, 1 + b, c)
	else:
		return tir(a, 1 + b, a[b]) or tir(a, b + 1, -a[b]) or tir(a, 1 + b, -1)

def abs(x):
	return x if x >= 0 else -x

def binary_search(li, val, lb, ub):
	ans = -1
	while lb <= ub:
		mid = (lb + ub) // 2
		if li[mid] > val:
			ub = mid - 1
		elif val > li[mid]:
			lb = mid + 1
		else:
			ans = mid
			break
	return ans

def kadane(x):
	sum_so_far = 0
	current_sum = 0
	for i in x:
		current_sum += i
		if current_sum < 0:
			current_sum = 0
		else:
			sum_so_far = max(sum_so_far, current_sum)
	return sum_so_far

def pref(li):
	pref_sum = [0]
	for i in li:
		pref_sum.append(pref_sum[-1] + i)
	return pref_sum

def SieveOfEratosthenes(n):
	prime = [True for i in range(n + 1)]
	p = 2
	li = []
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	for p in range(2, len(prime)):
		if prime[p]:
			li.append(p)
	return li

def primefactors(n):
	factors = []
	while n % 2 == 0:
		factors.append(2)
		n //= 2
	for i in range(3, int(sqrt(n)) + 1, 2):
		while n % i == 0:
			factors.append(i)
			n //= i
	if n > 2:
		factors.append(n)
	return factors

def read():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

def tr(n):
	return n * (n + 1) // 2

def ti(x):
	import math
	if x >= 0:
		s = math.sqrt(x)
	if s * s == x:
		return 1
	return 0
boi = 998244353

def ryu(a, b):
	re = 1
	while b != 0:
		if b % 2 != 0:
			re *= a
			re %= boi
		b = b // 2
		a *= a
		a %= boi
	return re
fa = [0] * 100007

def pow(x, y, p):
	re = 1
	x = x % p
	while y > 0:
		if y % 2 != 0:
			re = re * x % p
		y = y // 2
		x = x * x % p
	return re

def mi(n, p):
	return pow(n, p - 2, p)

def ncr(n, r, p):
	if n < r:
		return 0
	if r == 0:
		return 1
	return fa[n] * mi(fa[r], p) % p * mi(fa[n - r], p) % p % p

def iu():
	import re
	import sys
	input = sys.stdin.readline
	import math as my
	(a, b) = mj()
	if a == 1:
		print(b)
	elif a % 2 != 0:
		b = b // (a - a // 2)
		print(b)
	else:
		b = b // (a - a // 2 + 1)
		print(b)

def main():
	for i in range(so()):
		iu()
BUFSIZE = 8192

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')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


import sys
input = sys.stdin.buffer.readline
read = sys.stdin.buffer.read
T = int(input())
for _ in range(T):
	(N, S) = map(int, input().split())
	c = N // 2 + 1
	print(S // c)


import sys
import copy
import os.path
import itertools
from sys import stdin, stdout
from collections import *
from math import gcd, ceil, floor
mod = int(1000000000.0 + 7)
m1 = float('inf')
if os.path.exists('Updated prg/Input3d.txt'):
	sys.stdout = open('Updated prg/Output3d.txt', 'w')
	sys.stdin = open('Updated prg/Input3d.txt', 'r')

def sinp():
	return input()

def ninp():
	return int(sinp())

def mapinp():
	return map(int, sinp().split())

def smapinp():
	return map(str, sinp().split())

def linp():
	return list(mapinp())

def sl():
	return list(sinp().split())

def power(n):
	return 1 << n

def prnt(a):
	print(a)

def prntl(a):
	print(a, end=' ')

def prntlist(l1):
	print(*l1)
for _ in range(ninp()):
	(n, s) = mapinp()
	prnt(s // (n // 2 + 1))


import sys
input = sys.stdin.readline

def solve():
	(n, s) = map(int, input().strip().split())
	(less, equal) = (0, 0)
	if n % 2:
		equal = (n - 1) / 2
	else:
		equal = n / 2
	ans = s / (equal + 1)
	return int(ans)
t = int(input())
for _ in range(t):
	print(solve())


import math
t = int(input())
for q in range(t):
	ns = input().split()
	n = int(ns[0])
	s = int(ns[1])
	r = n - math.ceil(n / 2) + 1
	print(s // r)


import math
for _ in range(int(input())):
	(n, s) = (int(x) for x in input().strip().split())
	print(math.floor(s / (n - math.ceil(n / 2) + 1)))


t = int(input())
ans = []
for _ in range(t):
	(n, s) = [int(x) for x in input().split()]
	if n & 1:
		ans.append(str(s // (n + 1 >> 1)))
	else:
		ans.append(str(s // ((n >> 1) + 1)))
print('\n'.join(ans))


t = int(input())
for _ in range(t):
	(n, s) = map(int, input().split())
	if n & 1:
		m = (n + 1) // 2
		print(s // m)
	else:
		m = n // 2 + 1
		print(s // m)


import re
import sys
exit = sys.exit
from bisect import bisect_left as bsl, bisect_right as bsr
from collections import Counter, defaultdict as ddict, deque
from functools import lru_cache
cache = lru_cache(None)
from heapq import *
from itertools import *
from math import inf
from pprint import pprint as pp
enum = enumerate
ri = lambda : int(rln())
ris = lambda : list(map(int, rfs()))
rln = sys.stdin.readline
rl = lambda : rln().rstrip('\n')
rfs = lambda : rln().split()
cat = ''.join
catn = '\n'.join
mod = 1000000007
d4 = [(0, -1), (1, 0), (0, 1), (-1, 0)]
d8 = [(-1, -1), (0, -1), (1, -1), (-1, 0), (1, 0), (-1, 1), (0, 1), (1, 1)]

def solve():
	(n, s) = ris()
	ans = 0
	k = 1 + n // 2
	(lo, hi) = (0, s)
	while lo <= hi:
		mid = lo + hi >> 1
		if k * mid <= s:
			ans = max(ans, mid)
		if k * mid < s:
			lo = mid + 1
		else:
			hi = mid - 1
	return ans
t = ri()
for _ in range(t):
	print(solve())


import sys

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())

def get_int():
	return int(sys.stdin.readline())

def get_string():
	return sys.stdin.readline().strip()
n = get_int()
final_result = []
for i in range(n):
	word = get_string()
	final_result.append(word)
xx = []
for i in range(n):
	xx.append(list(map(int, final_result[i].split())))

def f(n, s):
	if n == 1:
		return s
	else:
		if n % 2 == 0:
			y = n // 2
		else:
			y = n // 2 + 1
		z = n - (y - 1)
		return s // z
for i in range(len(xx)):
	print(f(xx[i][0], xx[i][1]))


from typing import *

def solve(n: int, s: int) -> int:
	i = (n - 1) // 2
	return s // (n - i)

def main():
	t = int(input())
	for _ in range(t):
		(n, s) = map(int, input().split())
		print(solve(n, s))
main()


import math
for _ in range(int(input())):
	(a, b) = map(int, input().split())
	x = math.ceil(a / 2)
	z = a - x + 1
	n = b // z
	print(n)


t = int(input())
for i in range(t):
	(n, s) = map(int, input().split())
	if n % 2 == 0:
		m = n // 2 - 1
	else:
		m = n // 2
	print(s // (n - m))


import sys
input = lambda : sys.stdin.readline().rstrip()
write = lambda x: sys.stdout.write(x + '\n')
debug = lambda x: sys.stderr.write(x + '\n')
writef = lambda x: print('{:.12f}'.format(x))
t = int(input())
for i in range(t):
	(n, s) = map(int, input().split())
	i = (n + 1) // 2 - 1
	v = s // (n - i)
	print(v)


import math
t = int(input())
datos = []
i = 0
while i < t:
	aux = input()
	datos.append(aux)
	i = i + 1
res = []
i = 0
while i < t:
	(n, s) = datos[i].split(' ')
	s = int(s)
	n = int(n)
	pos = math.ceil(n / 2)
	if n % 2 == 0:
		pos += 1
	aux = int(s / pos)
	res.append(str(aux))
	i = i + 1
i = 0
while i < t:
	print(res[i])
	i = i + 1


from math import ceil

def solve(n, s):
	pos = ceil(n / 2)
	ans = s // (n - (pos - 1))
	return ans
t = int(input())
for i in [0] * t:
	(n, s) = map(int, input().split())
	print(solve(n, s))


import math
for t in range(int(input())):
	(len, sum) = map(int, input().split())
	median = math.floor(len / 2) + 1
	maxMedian = math.floor(sum / median)
	print(maxMedian)


import sys
import collections
import math
inf = sys.maxsize

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def get_array():
	return list(map(int, sys.stdin.readline().strip().split()))

def input():
	return sys.stdin.readline().strip()
mod = 1000000007
for _ in range(int(input())):
	(a, b) = get_ints()
	print(b // (a // 2 + 1))


t = int(input())
for _ in range(t):
	(n, s) = map(int, input().split())
	x = n - n // 2 + ~n % 2
	print(s // x)


cases = []
for _ in range(int(input())):
	cases.append(map(int, input().split()))
for (n, s) in cases:
	len_max = int(n / 2) + 1
	left_pointer = 0
	right_pointer = s
	max_median = 0
	while left_pointer <= right_pointer:
		mid_pointer = int((right_pointer + left_pointer) / 2)
		if mid_pointer * len_max > s:
			right_pointer = mid_pointer - 1
		else:
			max_median = mid_pointer
			left_pointer = mid_pointer + 1
	print(max_median)


import math

def median_maximizer(n, s):
	max_median = math.floor(s / (n - math.ceil(n / 2) + 1))
	return max_median
number_of_test_cases = int(input())
tests = []
for i in range(number_of_test_cases):
	(n, s) = [int(x) for x in input().split()]
	tests.append({'input': {'n': n, 's': s}})
for test in tests:
	print(median_maximizer(**test['input']))


n = int(input())
for i in range(n):
	r = [int(x) for x in input().split()]
	print(r[1] // ((r[0] + 2) // 2))


def ii():
	return int(input())

def si():
	return input()

def mi():
	return map(int, input().split())

def msi():
	return map(str, input().split())

def li():
	return list(mi())
t = ii()
for _ in range(t):
	(n, s) = mi()
	if n % 2 == 0:
		print(s // (n - (n // 2 - 1)))
	else:
		print(s // (n - n // 2))


import bisect
import heapq
import math
import sys
import itertools
input = lambda : sys.stdin.readline().rstrip()

def solve():
	(n, s) = map(int, input().split())
	mid = (n + 1) // 2
	print(s // (n - mid + 1))
t = int(input())
for _ in range(t):
	solve()


from sys import stdout, stdin
from io import IOBase, BytesIO
from os import read, write, fstat
BUFSIZE = 8192

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 = read(self._fd, max(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, size: int=...):
		while self.newlines == 0:
			b = read(self._fd, max(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:
			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')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
(stdin, stdout) = (IOWrapper(stdin), IOWrapper(stdout))

def input():
	return stdin.readline().rstrip('\r\n')

def main():
	t = int(input())
	for _ in range(t):
		(n, s) = map(int, input().split())
		zero_count = (n - 1) // 2
		other_count = n - zero_count
		answer = s // other_count
		print(answer)
main()


import sys
import math
for _ in range(int(input())):
	(n, s) = list(map(int, input().split()))
	if n % 2 == 0:
		x = n // 2
		ans = s // (x + 1)
		print(ans)
	else:
		x = math.ceil(n / 2)
		ans = s // x
		print(ans)


from __future__ import division, print_function
import os, math, threading
import sys
from io import BytesIO, IOBase
from typing import DefaultDict
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip
from types import GeneratorType

def nextLargerElement(arr, n, f):
	s = []
	ans = [-1] * n
	for i in range(n):
		while s and arr[s[-1]] < arr[i]:
			s.pop()
		if s:
			ans[i] = s[-1]
		s.append(i)
	if f:
		for i in range(n):
			if ans[i] != -1:
				ans[i] = n - 1 - ans[i]
	return ans

def dfs(i, adj, p, ans):
	f = True
	a1 = 0
	for j in adj[i]:
		if j != p:
			a1 += dfs(j, adj, i, ans + 1)
			f = False
	if f:
		a1 += ans * (ans - 1) // 2
	return a1

def main():
	for _ in range(int(input())):
		(n, s) = map(int, input().split())
		print(s // ((n + 2) // 2))
BUFSIZE = 8192

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')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


a = int(input())
for i in range(a):
	b = list(map(int, input().split()))
	res = 0
	x = int(b[0] // 2 + 1)
	res = int(b[1] // x)
	print(res)


for _ in range(int(input())):
	(n, s) = map(int, input().split())
	if n == 1:
		print(s)
		continue
	if s == 1:
		print(0)
		continue
	if n == s:
		print(1)
		continue
	if n % 2 != 0:
		val = (n + 1) // 2
		print(s // val)
	else:
		val = n // 2
		rm = n - val
		rm = rm + 1
		print(s // rm)


t = int(input())
for i in range(t):
	n = list(map(int, input().strip().split()))[:2]
	print(n[1] // (n[0] // 2 + 1))


import math
n = int(input())
for i in range(n):
	(a, b) = map(int, input().split())
	if a == 1:
		print(b)
		continue
	elif a == 2:
		print(int(b / 2))
		continue
	elif a % 2 == 1:
		k = math.ceil(a / 2)
		print(math.floor(b / k))
	else:
		k = a / 2 + 1
		print(math.floor(b / k))


import sys
import math
count = int(sys.stdin.readline())
while count > 0:
	count = count - 1
	arr = list(sys.stdin.readline().split(' '))
	n = int(arr[0])
	s = int(arr[1])
	p = int((n - n % 2) / 2) + n % 2 - 1
	hvost = n - p
	if hvost == 0:
		print(s)
	else:
		ostNaPoslednee = s % hvost
		print(math.floor(s / hvost))


from math import ceil
T = int(input())
A = [[*map(int, input().split())] for i in range(T)]
for i in range(T):
	print(A[i][1] // (A[i][0] - ceil(A[i][0] / 2) + 1))


import os, sys
from io import BytesIO, IOBase
from collections import deque, Counter, defaultdict as dft
from heapq import heappop, heappush
from math import log, sqrt, factorial, cos, tan, sin, radians, log2, ceil, floor, gcd
from bisect import bisect, bisect_left, bisect_right
from decimal import *
import sys, threading
from itertools import permutations, combinations
from copy import deepcopy
input = sys.stdin.readline

def modI(a, m):
	m0 = m
	y = 0
	x = 1
	if m == 1:
		return 0
	while a > 1:
		q = a // m
		t = m
		m = a % m
		a = t
		t = y
		y = x - q * y
		x = t
	if x < 0:
		x += m0
	return x
ii = lambda : int(input())
si = lambda : input().rstrip()
mp = lambda : map(int, input().split())
ms = lambda : map(str, input().strip().split(' '))
ml = lambda : list(mp())
mf = lambda : map(float, input().split())
alphs = 'abcdefghijklmnopqrstuvwxyz'

def solve():
	(n, s) = mp()
	idx = ceil(n / 2)
	idx -= 1
	temp = s // (n - idx)
	print(temp)
BUFSIZE = 8192

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')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

class SegmentTree:

	def __init__(self, data, default=0, func=gcd):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		start += self._size
		stop += self._size
		res_left = res_right = self._default
		while start < stop:
			if start & 1:
				res_left = self._func(res_left, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res_right = self._func(self.data[stop], res_right)
			start >>= 1
			stop >>= 1
		return self._func(res_left, res_right)

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)
tc = 1
tc = ii()
for i in range(tc):
	solve()


def f(n, s):
	if n % 2 == 1:
		k = n - n // 2
		return s // k
	else:
		k = n // 2 + 1
		return s // k
m = []
x = int(input())
for i in range(x):
	y = input()
	y1 = y.split(' ')
	y2 = [int(t) for t in y1]
	m.append(y2)
for j in range(x):
	print(f(m[j][0], m[j][1]))


n = int(input())

def solve():
	arr = input().split(' ')
	n = int(arr[0])
	s = int(arr[1])
	if n > s:
		if n % 2 == 0:
			n = n // 2 + 1
		else:
			n = (n + 1) // 2
		if n > s:
			return 0
		else:
			return 1
	if n == s:
		return 1
	if n == 1:
		return s
	k = 0
	if n % 2 == 0:
		n = n // 2 + 1
		return s // n
	else:
		n = (n + 1) // 2
		k = s // n
		return k
for i in range(n):
	print(solve())


from collections import defaultdict as dd
import math
import sys
input = sys.stdin.readline

def nn():
	return int(input())

def li():
	return list(input())

def mi():
	return map(int, input().split())

def lm():
	return list(map(int, input().split()))

def solve():
	(n, s) = mi()
	needed = n - (n - 1) // 2
	print(s // needed)
q = nn()
for _ in range(q):
	solve()


l = []
test_case = int(input())
for i in range(test_case):
	l1 = [int(x) for x in input().split()]
	x = int(l1[0] / 2) + 1
	y = int(l1[1] / x)
	l.append(y)
for i in l:
	print(i)


import sys
input = sys.stdin.readline

def solve():
	(n, s) = map(int, input().split())
	m = (n + 1) // 2 - 1
	print(s // (n - m))
for i in range(int(input())):
	solve()


import sys
from math import sqrt, ceil, floor, gcd
from collections import Counter
input = lambda : sys.stdin.readline()

def int_arr():
	return list(map(int, input().split()))

def str_arr():
	return list(map(str, input().split()))

def get_str():
	return map(str, input().split())

def get_int():
	return map(int, input().split())

def get_flo():
	return map(float, input().split())

def lcm(a, b):
	return a * b // gcd(a, b)
mod = 1000000007

def solve():
	pass
for _ in range(int(input())):
	(n, k) = get_int()
	if n == 1:
		print(k)
	else:
		print(k // (n - n // 2 + 1) if not n % 2 else k // (n - (n // 2 + 1) + 1))


t = int(input())
ans = []
for i in range(t):
	(n, s) = map(int, input().split())
	if n % 2 == 0:
		k = n // 2 - 1
	else:
		k = n // 2
	ans.append(s // (n - k))
for i in ans:
	print(i)


for _ in [*open(0)][1:]:
	(n, s) = map(int, _.split())
	print(s // (n - (n - 1 >> 1)))


cases = int(input())
for _ in range(cases):
	(n, s) = map(int, input().split())
	md = (n + 1) // 2
	rem = n - md + 1
	ans = s // rem
	print(ans)


import sys
import os
cin = [lambda : input(), lambda : int(input()), lambda : input().split(), lambda : [int(a) for a in input().split()]]

def solve():
	(n, s) = cin[-1]()
	m = (n + 1) // 2
	if s % (n - m + 1) == 0:
		print(s // (n - m + 1))
	else:
		print(s // (n - m + 1))

def main():
	if os.path.exists('input.txt'):
		sys.stdin = open('input.txt', 'r')
		sys.stdout = open('output.txt', 'w')
	t = 1
	t = cin[1]()
	while t:
		t -= 1
		solve()
main()


import sys
input = sys.stdin.readline
t = int(input())
while t > 0:
	(n, m) = map(int, input().split())
	x = n // 2 + 1
	print(m // x)
	t -= 1


import sys
import math as mt
input = sys.stdin.readline
I = lambda : list(map(int, input().split()))
xor = [0]
for tc in range(int(input())):
	(n, s) = I()
	mid = (n + 1) // 2
	print(s // (n - mid + 1))


import sys
from math import ceil, floor
for tc in range(int(input())):
	(n, s) = map(int, input().split(' '))
	d = floor(n / 2) + 1
	print(s // d)


n = int(input())
for i in range(n):
	n = list(map(int, input().split()))
	if n[0] % 2 == 0:
		k = n[0] / 2 + 1
	else:
		k = (n[0] + 1) / 2
	print(int(n[1] // k))


def solve(n, s):
	half = (n + 1) // 2 - 1
	return s // (n - half)
tests = int(input())
for _ in range(tests):
	(n, s) = map(int, input().split())
	print(solve(n, s))


from collections import defaultdict, Counter
from math import ceil
test = int(input())
for t in range(test):
	(n, s) = map(int, input().split())
	numerator = s - (ceil(n / 2) - 1)
	denominator = n - ceil(n / 2) + 1
	ans = s // denominator
	print(max(ans, 0))


for __ in range(int(input())):
	(N, S) = map(int, input().split())
	print(S // (N // 2 + 1))


t = int(input())
while t:
	t -= 1
	(n, s) = map(int, input().split())
	print(s // (n // 2 + 1))


import math
t = int(input())
cases = []
for i in range(t):
	cases.append(list(map(int, input().split())))

def answer(n, a):
	if n == 1:
		return a
	else:
		k = math.ceil(n / 2)
		if n % 2 == 1:
			return a // k
		else:
			return a // (k + 1)
for i in cases:
	print(answer(i[0], i[1]))


from math import ceil, floor
T = int(input())
TestCases = []
for i in range(T):
	(n, s) = map(int, input().split(' '))
	TestCases.append((n, s))
for i in range(T):
	(n, s) = TestCases[i]
	if n == 1:
		print(s)
		continue
	if s == 1:
		print(0)
		continue
	mid = n - ceil(n / 2) + 1
	print(floor(s / mid))


from __future__ import division, print_function
import os
import sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip
BUFSIZE = 8192

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')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
import collections, string, bisect, re, random, queue, itertools, statistics, math
from collections import *
from bisect import *
from string import *
from itertools import *
from statistics import *
from math import *
from re import *
from queue import *

class Stack:

	def __init__(self):
		self.items = []

	def push(self, item):
		self.items.append(item)

	def pop(self):
		return self.items.pop()

	def empty(self):
		return self.items == []

	def size(self):
		return len(self.items)

	def at(self, idx):
		try:
			return self.items[idx]
		except:
			return -1

class priority_queue(object):

	def __init__(self):
		self.queue = []

	def __str__(self):
		return ' '.join([str(i) for i in self.queue])

	def empty(self):
		return len(self.queue) == 0

	def push(self, data):
		self.queue.append(data)

	def pop(self):
		try:
			max = 0
			for i in range(len(self.queue)):
				if self.queue[i] > self.queue[max]:
					max = i
			item = self.queue[max]
			del self.queue[max]
			return item
		except IndexError:
			print()
			exit()
mod = int(1000000000.0 + 7)
imax = float('inf')
imin = float('-inf')
true = True
false = False
N = int(100000.0 + 10)
none = None
inp = lambda : input()
I = lambda : int(inp())
M = lambda : map(int, inp().split())
MS = lambda : map(str, inp().split())
S = lambda : list(MS())
L = lambda : list(M())

def IO():
	try:
		sys.stdin = open('input.txt', 'r')
		sys.stdout = open('uttar.txt', 'w')
	except:
		pass
IO()

def kabraji_ka_totka():
	(n, s) = L()
	if n == 1:
		print(s)
		return
	if n % 2 == 0:
		s //= n - n // 2 + 1
		print(s)
		return
	s //= n - n // 2
	print(s)
for i in range(I()):
	kabraji_ka_totka()


for x in range(int(input())):
	s = input()
	i = s.find(' ')
	a = int(s[:i])
	b = int(a / 2) + 1
	c = int(s[i + 1:])
	print(c // b)


T = int(input())
for t in range(T):
	(n, m) = map(int, input().split())
	if n % 2:
		ans = m // (n - n // 2)
	else:
		ans = m // (n - n // 2 + 1)
	print(ans)


T = int(input())
while T:
	T -= 1
	(n, s) = map(int, input().split())
	print(s // (n // 2 + 1))


from math import ceil
for _ in range(int(input())):
	(l, s) = map(int, input().split())
	if l % 2 == 0:
		l -= (l - 1) // 2
	else:
		l -= l // 2
	print(s // l)