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

public class Main {
    private static final fast sc = new fast();
    private static final Scanner sca =new Scanner(System.in);
    private static final BufferedWriter sout = new BufferedWriter(new OutputStreamWriter(System.out));
    private static final int OO = (int) 1e9 + 1;
    private static final double PI = 3.141592653;
    private static final int[] dx4 = {0, 1, 0, -1}, dx = {0, 0, 1, -1, 1, -1, 1, -1};
    private static final int[] dy4 = {1, 0, -1, 0}, dy = {1, -1, 0, 0, 1, -1, -1, 1};
    //static void print6P{ System.out.printf("%8.6f\n"); }
  
    public static void main(String[] args) throws IOException {
       int t =sc.nextInt();
       while(t-->0){
            long n =sc.nextLong(),k =sc.nextLong();
            if(n<=k){
                sout.write(1+"");
            }else{
                if(isPrime(n)){
                    sout.write(n+"");
                }else{
                    long r = n,rr=OO;
                    for (int i = 1; i*i <= n; i++){
                        if (n % i == 0){
                            if(i<=k){
                                rr = Math.min(rr,n/i);
                            }
                            if(n/i <= k){
                                 rr = Math.min(rr,i);
                            }
                            
                           r = 0;
                          // sout.write(i+" ");
                        } 
                    }
                    sout.write((r==n ?r:rr)+"");
                }
            }
           sout.write("\n");
       }
        sout.close();
    }
    
    
    static boolean isPrime(long number){
        if (number < 2) {
            return false;
        }
        if (number % 2 == 0){
            return (number == 2);
        } 
        //int root = (int)Math.Sqrt((double)number);
        for (int i = 3; i*i <= number; i += 2){
            if (number % i == 0){
                return false;
            } 
        }
        return true;
    }
    static long gcd(long a, long b) {
      if (b == 0)
        return a;
      return gcd(b, a % b);
    }
    static class fast {
        BufferedReader br;
        StringTokenizer st;

        public fast() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }


        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        double nextFloat() {
            return Float.parseFloat(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
    static class Pair implements Comparable<Pair> {
        int first;
        int second;

        Pair(int first, int second) {
            this.first = first;
            this.second = second;
        }

        @Override
        public int compareTo(Pair o) {
            return Double.compare(o.first, first);
        }

        @Override
        public boolean equals(Object o) {
            if (this == o) {
                return true;
            }
            if (!(o instanceof Pair)) {
                return false;
            }
            Pair pair = (Pair) o;
            if (first != pair.first) {
                return false;
            }
            return second == pair.second;
        }
    }
    static class Triple implements Comparable<Triple> {
        int first;
        int second;
        int third;

        Triple(int first, int second, int third) {
            this.first = first;
            this.second = second;
            this.third = third;
        }

        @Override
        public int compareTo(Triple o) {
            return Double.compare(o.first, first);
        }
    }
}
