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] 
import java.util.*;
import java.io.*;

public class Template {

		public static class FastScanner {
			BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
			StringTokenizer st = new StringTokenizer("");
			String next () {
				while(!st.hasMoreTokens()) {
					try {
						st=new StringTokenizer(br.readLine());
					}catch(IOException e) {
						e.printStackTrace();
					}
				}
				return st.nextToken();
			}
			
			int nextInt() {
				return Integer.parseInt(next());
			}
			
			int[] readArray(int n) {
				int a[] = new int[n];
				for(int i=0;i<n;i++) {
					a[i] = nextInt();
				}
				return a;
			}
			
			long nextLong() {
				return Long.parseLong(next());
			}
		}
		
		//prime sieve
		public static boolean sieve[];
		public static void sievePrime(int n) {
			sieve = new boolean[n+1];
			for(int i=2;i*i<=n;i++) {
				if(sieve[i] == false) { //means prime hai
					for(int j=i+i;j<sieve.length;j+= i) {
						sieve[j] = true;
					}
				}
			}
			
		}
		
		//swap
		public static void swap(int a,int b) {
			int temp= a;
			a=b;
			b=temp;
		}
		
		//Longest Palindromic String
		 public String manacher(String s){
		        StringBuilder sb = new StringBuilder();
		        sb.append("@");
		        for(int i=0;i<s.length();i++){
		            sb.append("#");
		            sb.append(s.charAt(i));
		        }
		        sb.append("#");
		        sb.append("$");
		        String ans = manacher_Util(sb.toString(),s);
		        return ans;
		    }
		    public String manacher_Util(String s,String org){
		        int lps[] = new int[s.length()];
		        int c = 0;
		        int r = 0;
		        for(int i=1;i<s.length()-1;i++){
		            int mirror = c - (i-c);
		            if(i<r){
		                lps[i] = Math.min(lps[mirror],r-i);
		            }
		        
		            while(s.charAt(1+i+lps[i]) == s.charAt(i-1-lps[i])){
		                lps[i]++;
		            }
		            if(i+lps[i] > r){
		                c= i ;
		                r = i+lps[i];
		            }
		        }
		        int maxlen = Integer.MIN_VALUE;
		        int maxindex = Integer.MIN_VALUE;
		        for(int i=1;i<lps.length-1;i++){
		            if(lps[i] > maxlen){
		                maxlen = lps[i];
		                maxindex = i;
		            }
		        }
		        int firstindex = maxindex - maxlen + 1;
		        int actualFirstIndex = (firstindex-2)/2;
		        return org.substring(actualFirstIndex,actualFirstIndex+maxlen);
		    }
		
		
		    //kmp
		    public static int lps[];
		    public static void kmp(String s) {
		    	lps = new int[s.length()];
		    	int i = 1;
		    	int len = 0;
		    	while(i<s.length()) {
		    		if(s.charAt(i) == s.charAt(len)) {
		    			len++;
		    			lps[i] = len;
		    			i++;
		    		}
		    		else {
		    			if(len>0) {
		    				len = lps[len - 1];
		    			}
		    			else {
		    				lps[i] = 0;
		    				i++;
		    			}
		    		}
		    	}
		    }

		public static void main(String[] args) {
		    FastScanner sc = new FastScanner();
			int test = sc.nextInt();
//			PrintWriter o = new PrintWriter(System.out);
		
			
			while(test-->0) {
				
				int n = sc.nextInt();
				int s = sc.nextInt();
				
				if(n<=s)
				{
					int a = (int)Math.round(n/2.0);
					int b = n-a;
					int c = b+1;
					
					int ans = s/c;
					System.out.println(ans);
				}else if(n==1)
				{
					System.out.println(s);
				}else {
					System.out.println(0);
				}
				
				
				
			}
			
		}
		
		static int gcd(int a, int b)
	    {
	      if (b == 0)
	        return a;
	      return gcd(b, a % b);
	    }
		
		public static int fac(int n)
		{
			int ans = 1;
			for(int i = 1;i<=n;i++)
			{
				ans *= i;
			}
			return ans;
		}
		
	}
