Polycarp wants to buy exactly n shovels. The shop sells packages with shovels. The store has k types of packages: the package of the i-th type consists of exactly i shovels (1 ≤ i ≤ k). The store has an infinite number of packages of each type.

Polycarp wants to choose one type of packages and then buy several (one or more) packages of this type. What is the smallest number of packages Polycarp will have to buy to get exactly n shovels?

For example, if n=8 and k=7, then Polycarp will buy 2 packages of 4 shovels.

Help Polycarp find the minimum number of packages that he needs to buy, given that he: 

  * will buy exactly n shovels in total; 
  * the sizes of all packages he will buy are all the same and the number of shovels in each package is an integer from 1 to k, inclusive. 

Input

The first line contains an integer t (1 ≤ t ≤ 100) — the number of test cases in the input. Then, t test cases follow, one per line.

Each test case consists of two positive integers n (1 ≤ n ≤ 10^9) and k (1 ≤ k ≤ 10^9) — the number of shovels and the number of types of packages.

Output

Print t answers to the test cases. Each answer is a positive integer — the minimum number of packages.

Example

Input


5
8 7
8 1
6 10
999999733 999999732
999999733 999999733


Output


2
8
1
999999733
1

Note

The answer to the first test case was explained in the statement.

In the second test case, there is only one way to buy 8 shovels — 8 packages of one shovel.

In the third test case, you need to buy a 1 package of 6 shovels.
import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
public class Main {
    static long MOD = 1000000007;
    static int modulo=998244353;
    static int parent[];
   
    public static void main(String[] args) {
       boolean prime[]=new boolean[(int)1e6+1];
       for(int i=0;i<=1e6;i++)
           prime[i]=true;
       
       for(int i=2;i*i<=1e6;i++){
           if(prime[i]==true){
           for(int j=i*i;j<=1e6;j+=i){
               prime[j]=false;
           }
           }
       }
       ArrayList<Integer> list=new ArrayList<>();
       for(int i=2;i<=1e6;i++){
           if(prime[i]==true)
               list.add(i);
       }
      
       
       Scanner in = new Scanner(System.in);
       int test=in.nextInt();
       while(test-->0){
           long n=in.nextLong();
           long k=in.nextLong();
           ArrayList<Long> list1=new ArrayList<Long>();
           for(long i=1;i*i<=n;i++){
               if(n%i==0){
                   list1.add(i);
                   if(n/i!=i)
                       list1.add(n/i);
               }
           }
           
            Collections.sort(list1);
            
//           for(int i=0;i<list1.size();i++)
//               System.out.print(list1.get(i)+" ");
           
          
           
           int index=-1;
           boolean flag=false;
           for(int i=0;i<list1.size();i++){
               if(list1.get(i)==k){
                   index=i;
               }
               else if(list1.get(i)>k){
                   flag=true;
                   if(i!=0)
                   index=i-1;
                   else
                       index=i;
                   break;
               }
               
           }
           if(!flag)
               index=list1.size()-1;
           
//           System.out.println(index);
           System.out.println(n/list1.get(index));
           }
    
               
           
           
       }
           
       
    
   
    public static boolean union(int u,int v){
        int par1=findRoot(u);
        int par2=findRoot(v);
        
        if(par1!=par2){
            par1=parent[par2];
            return true;
        }
        
        return false;
    }
    public static int findRoot(int u){
        while(parent[u]!=u)
            u=parent[u];
        
        return u;
    }
    public static void dfs(int curr,int parent,int height[],ArrayList<Integer> arr[])
{
		for(int i:arr[curr])
		{
			if(i!=parent){
				height[i]=height[curr]+1;
				dfs(i,curr,height,arr);
			}
		}	

}
    public static double bs( double w,double min1,double min2,int n){
        double left=0;
        double right=w;
        double ans=0;
        int i=0;
        while(i<=100){
            double mid=(left+right)/2;
            if(mid<=min1 && 2*mid<=min2 && 3*n*mid<=w){
                ans=n*mid+2*n*mid;
                left=mid;
            }
            else{
                right=mid;
            }
            i++;


        }
        return ans;
        
    }
    
     public static boolean check (double time,long x[],long r[],int N) {
   
      double l = x[0]-r[0]*time;
      double h = x[0]+r[0]*time;
      for (int k=1; k<N; k++) {
         //System.out.println(l+" "+h+" "+(x[k]-r[k]*time)+" "+(x[k]+r[k]*time));
         if ((x[k]-r[k]*time)>h || (x[k]+r[k]*time)<l)
            return false;
         //update bounds if neccessary
         if ((x[k]-r[k]*time)>l)
            l=x[k]-r[k]*time;
         if ((x[k]+r[k]*time)<h)
            h=x[k]+r[k]*time;
      }
      return true;
   }
    
     public static int solve(int n,int m,ArrayList<pair> list1,int k){
         int low=1;
         int high=n*m;
         int a=0;
         while(low<=high){
             int mid=(low+high)/2;
             int ans[][]=create(n,m,list1,mid);
//             for(int i=0;i<=n;i++){
//                 for(int j=0;j<=m;j++){
//                     System.out.print(ans[i][j]+" ");
//                 }
//                 System.out.println();
//             }
             int pre[][]=prefix(n,m,ans);
             
             if(check(pre,n,m,k)){
                 
                 if(mid%2==1)
                     a=1;
                 else
                     a=-1;
                 
                 high=mid-1;
             }
             else
                 low=mid+1;
         }
         
         return a;
     }
     public static int [][] prefix(int n,int m,int arr[][]){
         int ans[][]=new int[n+1][m+1];
         for(int i=1;i<=n;i++){
             for(int j=1;j<=m;j++){
                 ans[i][j]=arr[i][j]+ans[i-1][j]+ans[i][j-1]-ans[i-1][j-1];
             }
         }
         return ans;
         
     }
     public static int[][] create(int n,int m,ArrayList<pair> list1,int mid){
         int arr[][]=new int[n+1][m+1];
         
             for(int i=0;i<mid;i++){
                 if(i%2==0)
                 arr[list1.get(i).x][list1.get(i).y]=1;
                 else
                  arr[list1.get(i).x][list1.get(i).y]=-1;   
             } 
             
             return arr;
     }
     public static boolean check(int arr[][],int n,int m,int k){
         
         int ans=0;
         for(int i=k;i<=n;i++){
             
             for(int j=k;j<=m;j++){
                 ans=arr[i][j]-arr[i][j-k]-arr[i-k][j]+arr[i-k][j-k];
             }
            
             
             if((int)Math.abs(ans)==k*k)
                 return true;
         }
         return false;
     }
     public static int[][] rotateGrid(int[][] grid, int k) {
        int top=0;
        int left=0;
        int bottom=grid.length-1;
        int right=grid[0].length-1;
        
        while(bottom>top&&right>left){
        int elements=2*(right-left+1)+2*(bottom-top+1)*2-4;
        
        int t=k%elements;
        
        while(t-->0){
            int temp = grid[top][left];
            for(int j = left; j<right; j++){
                grid[top][j] = grid[top][j+1];
            }
            for(int i = top; i<bottom; i++){
                grid[i][right] = grid[i+1][right];
            }
            for(int j = right; j>left; j--){
                grid[bottom][j] = grid[bottom][j-1]; 
            }
            for(int i = bottom; i>top; i--){
                grid[i][left] = grid[i-1][left];
            }
            grid[top+1][left]=temp;
        }
        top++;
        left++;
        right--;
        bottom--;
        
    }
        return grid;
    }
    
    public static void solve1(int n,int arr[]){
        int b[]=new int[2*n+1];
        for(int i=0;i<n;i++){
            b[arr[i]]=i+1;
        }
        int count=0;
        for(int i=3;i<2*n;i++){
        for(int j=1;j*j<i;j++){
            if(i%j==0 && i!=j*j){
                if(b[j]+b[i/j]==i){
                    count++;
                }
            }
        }
    }
        System.out.println(count);
    }
    public static long modpow(long a, long b){
	    if(b==0){
	        return 1;
	    }
	    long x = modpow(a, b/2);
	    x = (x*x)%modulo;
	    if(b%2==1){
	        return (x*a)%modulo;
	    }
	    return x;
	}
    public static long factorial(long n){
        if(n==1) return 1;
        if(n==2) return 2;
        if(n==3) return 6;
        return n*factorial(n-1);
    }
    public static long benches(int n){
        return ncr(n,5)*n*(n-1)*(n-2)*(n-3)*(n-4);
    }
    public static long ncr(int n,int r){
        long dp[][]=new long[n+1][r+1];
        
        for(int i=0;i<=n;i++){
            for(int j=0;j<=Math.min(i,r);j++){
                if(j==0 ||j==i)
                    dp[i][j]=1;
                else{
                    dp[i][j]=dp[i-1][j]+dp[i-1][j-1];
                }
            }
        }
        
        return dp[n][r];
    }
    public static  long select(int n){
    return ncr(n,5)+ncr(n,6)+ncr(n,7);

    }
    public static long ncr1(int n,int r){
        long k=Math.max(r,n-r);
        long num=1;
        long den=1;
        long j=1;
        
        for(long i=n;i>k;i--){
            num*=i;
            den*=j;
            j++;
        }
        return num/den;
    }
    public static int countDiff(int arr[],int n,int diff){
        int sum=0;
       
        for(int i=0;i<n;i++){
            
            sum+=arr[i];
        }
        
        int max=sum/2;
        
        boolean dp[][]=new boolean[n+1][max+1];
        
        for(int i=0;i<=n;i++){
            for(int j=0;j<=max;j++){
                if(i==0)
                    dp[i][j]=false;
                if(j==0)
                    dp[i][j]=true;
            }
        }
        
        for(int i=1;i<=n;i++){
            for(int j=1;j<=max;j++){
                if(arr[i-1]<=j)
                    dp[i][j]=dp[i-1][j]||dp[i-1][j-arr[i-1]];
                else
                    dp[i][j]=dp[i-1][j];
            }
        }
        int min=0;
        int count=0;
        for(int j=0;j<=max;j++){
            min=0;
            if(dp[n][j]==true){
                min=sum-2*j;
                if(min==diff)
                    count++;
            }
        }
        
        return count;
    }
    public static long permutation(long n,long r){
        if(n==0)
            return 1;
        
        long ans=n;
        for(long i=n-1;i>(n-r);i--){
            ans=(ans*i)%MOD;
        }
        return ans;
    }
    public static int minimumDiff(int arr[],int n){
        int sum=0;
       
        for(int i=0;i<n;i++){
            
            sum+=arr[i];
        }
        
        int max=sum/2;
        
        boolean dp[][]=new boolean[n+1][max+1];
        
        for(int i=0;i<=n;i++){
            for(int j=0;j<=max;j++){
                if(i==0)
                    dp[i][j]=false;
                if(j==0)
                    dp[i][j]=true;
            }
        }
        
        for(int i=1;i<=n;i++){
            for(int j=1;j<=max;j++){
                if(arr[i-1]<=j)
                    dp[i][j]=dp[i-1][j]||dp[i-1][j-arr[i-1]];
                else
                    dp[i][j]=dp[i-1][j];
            }
        }
        int min=Integer.MAX_VALUE;
        for(int j=0;j<=max;j++){
            if(dp[n][j]==true){
                min=Math.min(min,sum-2*j);
            }
        }
        
        return min;
    }
    public static int findTargetSumWays(int[] nums, int target) {
        int n=nums.length;
         int dp[][]=new int[n+1][target+1];
         
         for(int i=0;i<=n;i++){
             for(int j=0;j<=target;j++){
                 if(i==0)
                 dp[i][j]=0;
                 
                 if(j==0)
                     dp[i][j]=1;
             }
         }
         
         for(int i=1;i<=n;i++){
             for(int j=1;j<=target;j++){
                 if(nums[i-1]<=j)
                     dp[i][j]=dp[i-1][j]+dp[i-1][j-nums[i-1]];
                 else
                     dp[i][j]=dp[i-1][j];
             }
         }
         
//         for(int i=0;i<=n;i++){
//             for(int j=0;j<=target;j++){
//                 System.out.print(dp[i][j]+" ");
//             }
//             System.out.println();
//         }
         
         return dp[n][target];
         
    }
    public static long gcd(long x, long y) {
        if (x == 0)
            return y;
        else
            return gcd(y % x, x);
    }
    public static long lcm(long x, long y) {
        return (x * (y / gcd(x, y)));
    }
    static int equalPartition(int n, int arr[],int sum)
    {
       
       
      
           int max=sum;
           boolean dp[][]=new boolean[n+1][max+1];
           
           for(int i=0;i<=n;i++){
               for(int j=0;j<=max;j++){
                   if(i==0)
                   dp[i][j]=false;
                   if(j==0)
                   dp[i][j]=true;
               }
           }
           
           for(int i=1;i<=n;i++){
               for(int j=1;j<=max;j++){
                   if(arr[i-1]<=j){
                       dp[i][j]=(dp[i-1][j]||dp[i-1][j-arr[i-1]]);
                   }
                   else{
                       dp[i][j]=dp[i-1][j];
                   }
               }
           }
           
           for(int i=0;i<=n;i++){
               for(int j=0;j<=max;j++){
                   System.out.print(dp[i][j]+" ");
               }
               System.out.println();
           }
           int count=0;
           for(int i=0;i<=n;i++){
            if(dp[i][max]==true){
               
                count++;
            }
            
        }
        return count;
       }
    
    public static long power(long base,long power){
        long res=1;
        while(power!=0){
            if(power%2==0){
                power/=2;
                base=(base*base);
            }
            else{
                power--;
                res=(res*base);
            }
            
        }
        return res;
    }
}
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());
		}
	}
class pair 
	    {
	        int x;
	        int y;
 
	        pair(int x, int y) {
	            this.x = x;
	            this.y = y;
	        }
	        
}