import std.stdio, std.string, std.algorithm, std.array;

void main()
{
    int t;
    scanf("%d", &t);
    getchar();
    foreach(i; 0..t){
	int n, s;
	scanf("%d %d", &n, &s);
	auto num_zero = (n - 1) / 2;
	writeln(s / (n - num_zero));
    }
}
