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.*;
//import java.math.*; // for bigInteger

public class Main {

  static InputReader sc;
  static PrintWriter out;

  public static void main(String args[]) throws Exception {
    sc = new InputReader();
    out = new PrintWriter(System.out);
    int t = 1;  
    t = sc.nI();
    for (int tt = 1; tt <= t; ++tt)
      solve(tt);
    out.close();
  }
  
  static void solve(int test) {
    int n = sc.nI(), k = sc.nI();
    if(k>=n)  out.println(1);
    else {
      int sqrt = (int)Math.sqrt(n);
      List<Integer> factors = new ArrayList<>();
      for(int i=1;i<=sqrt;++i) {
        if(n%i==0) factors.add(i);
      }  
      //complementary
      for(int i=factors.size()-1;i>=0;--i) {
        factors.add(n/factors.get(i));
      }
      int great = factors.get(0);
      for(int factor : factors) {
        if(factor<=k) great = factor;
        else break;
      }
      out.println(n/great);
    }
  }

  static int lowerBound(int[] a, int n, int target) {
    int left = 0, right = n-1;
    int ans = n;
    while(left<=right) {
      int mid = left + ((right-left)>>1);
      int x = a[mid];
      if(x>=target) {
        ans  = mid;
        right = mid-1;
      }
      else left = mid+1;  
    }
    return ans;
  }
 
  public static class InputReader {
    BufferedReader br;
    StringTokenizer st;

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

    public int nI() {
      return Integer.parseInt(n());
    }

    public long nL() {
      return Long.parseLong(n());
    }

    public double nD() {
      return Double.parseDouble(n());
    }

    public String n() {
      while (st == null || !st.hasMoreTokens()) {
        try {
          st = new StringTokenizer(br.readLine());
        } catch (IOException e) {
        }
      }
      return st.nextToken();
    }
  }

  /*
   * private final static int m =(int)1e9+7; private static class Pair<T,V> { T
   * first; V second; Pair(final T first, final V second) { this.first = first;
   * this.second = second; } public boolean equals(Object o) { Pair given =
   * (Pair)o; if(given.first == first && given.second == second) return true;
   * return false; } public int hashCode() { long temp =
   * (long)(first.hashCode())*31; temp = (temp+(long)second.hashCode())%m; return
   * (int)temp; } }
   */

  public static void debug(final int[]... var) {
    for (final int[] row : var) {
      debug(row);
    }
  }

  public static void debug(final long[]... var) {
    for (final long[] row : var) {
      debug(row);
    }
  }

  public static void debug(final String[]... var) {
    for (final String[] row : var) {
      debug(row);
    }
  }

  public static void debug(final double[]... var) {
    for (final double[] row : var) {
      debug(row);
    }
  }

  public static void debug(final char[]... var) {
    for (final char[] row : var) {
      debug(row);
    }
  }

  public static void debug(final int... var) {
    for (final int i : var)
      System.err.print(i + " ");
    System.err.println();
  }

  public static void debug(final String... var) {
    for (final String i : var)
      System.err.print(i + " ");
    System.err.println();
  }

  public static void debug(final double... var) {
    for (final double i : var)
      System.err.print(i + " ");
    System.err.println();
  }

  public static void debug(final long... var) {
    for (final long i : var)
      System.err.print(i + " ");
    System.err.println();
  }

  public static void debug(final char... var) {
    for (final char c : var)
      System.err.print(c + " ");
    System.err.println();
  }

  /*
   * public static <T> void debug(T ...varargs) { // Warning // Heap Pollution
   * might occur // this overrides even 1d and 2d array methods as it is an
   * object... // + i am not using object based array like Integer[] // I am using
   * int[] so that is a problem as i need Wrapper class as an argument for(T
   * val:varargs) System.err.printf("%s ",val); System.err.println(); }
   */
}
