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

public class Codeforces{
    // Input
    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;
        public InputReader() {
            reader = new BufferedReader(new InputStreamReader(System.in));
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

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

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

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

        public String nextLine() {
            String s = null;
            try {
                s = reader.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
            return s;
        }

        public String nextParagraph() {
            String line = null;
            String ans = "";
            try {
                while ((line = reader.readLine()) != null) {
                    ans += line;
                }
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
            return ans;
        }
    }
    //Template
    static int mod = 998244353;
    static void printArray(int ar[]){ for(int x:ar) System.out.print(x+" ");}
    static void printArray(ArrayList<Integer> ar){ for(int x:ar) System.out.print(x+" ");}
    static long gcd(long a, long b){ if (a == 0) return b; return gcd(b%a, a);}
    static long power(long x, long y, int p) { long res = 1; x = x % p;  while (y > 0) { if((y & 1)==1) res = (res * x) % p; y = y >> 1;x = (x * x) % p;  } return res;}
    static void takeArrayInput(InputReader sc, int ar[]){ for(int i=0;i<ar.length;i++) ar[i]=sc.nextInt(); }
    static void takeArrayInput(InputReader sc, long ar[]){ for(int i=0;i<ar.length;i++) ar[i]=sc.nextLong(); }
    static void take2dArrayInput(InputReader sc, int ar[][]){ for(int i=0;i<ar.length;i++) for(int j=0;j<ar[i].length;j++) ar[i][j]=sc.nextInt(); }
    static void take2dArrayInput(InputReader sc, long ar[][]){ for(int i=0;i<ar.length;i++) for(int j=0;j<ar[i].length;j++) ar[i][j]=sc.nextLong(); }
    static ArrayList<ArrayList<Integer>> graph(InputReader sc, int n, int m){
        ArrayList<ArrayList<Integer>> list = new ArrayList<ArrayList<Integer>>();
        for(int i=0;i<n;i++) list.add(new ArrayList<Integer>());
        for(int i=0;i<m;i++){ int u = sc.nextInt(); int v = sc.nextInt(); list.get(u).add(v); list.get(v).add(u); }
        return list;
    }
    // Write Code Here
    static class Data {
        int u;
        int v;
        public Data(int e, int val) {
            this.u = e;
            this.v = val;
        }
    }
    static void sieveOfEratosthenes(int n, ArrayList<Integer> pr) {
        // Create a boolean array "prime[0..n]" and initialize
        // all entries it as true. A value in prime[i] will
        // finally be false if i is Not a prime, else true.
        boolean prime[] = new boolean[n + 1];
        for (int i = 0; i < n; i++)
            prime[i] = true;
        for (int p = 2; p * p <= n; p++) {
            // If prime[p] is not changed, then it is a prime
            if (prime[p] == true) {
                // Update all multiples of p
                pr.add(p);
                for (int i = p * p; i <= n; i += p)
                    prime[i] = false;
            }
        }
    }

    static int findPackage(int n, int k) {
        int i = 0;
        int up = (int)Math.sqrt(n);
        List<Integer> f = new ArrayList<>();
        for (i = 1 ; i <= up; i++) {
            if ((n%i) == 0) {
                f.add(i);
            }
        }
        i = 0;
        while (i<f.size() && (n/f.get(i)) > k) {
            i++;
        }
        if (i != f.size())
            return f.get(i);
        i--;
        while (i >= 0 && f.get(i) > k) {
            i--;
        }
        return n/f.get(i);
    }
    public static void main(String args[]) {
        InputReader sc = new InputReader();
        PrintWriter pw = new PrintWriter(System.out);
        int t = sc.nextInt();
        int i = 0 , j=0;
        for (int z = 0; z < t; z++) {
            int n =  sc.nextInt(), k = sc.nextInt();
            pw.println(findPackage(n, k));

        }
        pw.close();
    }
}