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.
#include <bits/stdc++.h>
using namespace std;
long long n;
long long ncr(long long n, long long r) {
  long long i, ans = 1, k = 0;
  if (r == 0)
    return 1;
  else if (n < r)
    return 0;
  for (i = n; i >= n - r + 1; i--) {
    ans *= i;
    ans /= n - i + 1;
  }
  return ans;
}
void max_heapify(int a[100], int i) {
  int l, r, largest = i;
  l = 2 * i + 1;
  r = 2 * i + 2;
  if (l < n && a[l] > a[i]) largest = l;
  if (r < n && a[r] > a[l]) largest = r;
  if (largest != i) {
    int k;
    k = a[i];
    a[i] = a[largest];
    a[largest] = k;
    max_heapify(a, largest);
  }
}
int power(long long x, long long y, long long p) {
  int res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
bool square(long long n) {
  double x;
  x = sqrt(n);
  if (x == floor(x))
    return true;
  else
    return false;
}
bool prime(long long n) {
  long long i;
  for (i = 2; i * i <= n; i++) {
    if (n % i == 0) return false;
  }
  return true;
}
long long modi(long long a, long long m) { return power(a, m - 2, m); }
void kmp(string s, long long p[]) {
  int n = (int)s.length();
  p[0] = 0;
  for (int i = 1; i < n; i++) {
    int j = p[i - 1];
    while (j > 0 && s[i] != s[j]) j = p[j - 1];
    if (s[i] == s[j]) j++;
    p[i] = j;
  }
}
void zfunc(string s, long long z[]) {
  long long n = (long long)s.length();
  z[0] = 0;
  for (long long i = 1, l = 0, r = 0; i < n; ++i) {
    if (i <= r) z[i] = min(r - i + 1, z[i - l]);
    while (i + z[i] < n && s[z[i]] == s[i + z[i]]) ++z[i];
    if (i + z[i] - 1 > r) l = i, r = i + z[i] - 1;
  }
}
struct pair_hash {
  size_t operator()(const pair<int, int>& p) const noexcept {
    return hash<long long>()((((long long)p.first) << 32) |
                             ((long long)p.second));
  }
};
bool palin(string s) {
  long long i, n;
  n = s.length();
  for (i = 0; i <= n / 2; i++) {
    if (s[i] != s[n - i - 1]) {
      return false;
    }
  }
  return true;
}
long long sum(long long n) {
  long long i;
  i = n;
  long long sum = 0;
  while (i > 0) {
    sum += i % 10;
    i = i / 10;
  }
  return sum;
}
long long nCr(long long n, long long r, long long p, long long fac[]) {
  if (r == 0) return 1;
  fac[0] = 1;
  for (int i = 1; i <= n; i++) fac[i] = fac[i - 1] * i % p;
  return (fac[n] * modi(fac[r], p) % p * modi(fac[n - r], p) % p) % p;
}
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long mod(string num, long long a) {
  long long res = 0;
  for (long long i = 0; i < num.length(); i++)
    res = (res * 10 + (long long)num[i] - '0') % a;
  return res;
}
long long parent[1000], sizer[1000];
long long findset(long long a) {
  if (a == parent[a]) {
    return a;
  }
  parent[a] = findset(parent[a]);
  return parent[a];
}
void unionset(long long a, long long b) {
  a = findset(a);
  b = findset(b);
  if (sizer[a] < sizer[b]) {
    swap(a, b);
  }
  sizer[b] += sizer[a];
  parent[b] = a;
}
struct fenwick {
  vector<long long> bit;
  long long n;
  fenwick(long long n, vector<long long> v) {
    this->n = n;
    bit.assign(n, 0);
    for (long long it = 0; it < n; it++) {
      add(it, v[it]);
    }
  }
  long long sum(long long idx) {
    if (idx < 0) return 0;
    long long ret = 0;
    for (; idx >= 0; idx = (idx & (idx + 1)) - 1) {
      ret += bit[idx];
    }
    return ret;
  }
  void add(long long idx, long long x) {
    for (; idx < n; idx = idx | (idx + 1)) {
      bit[idx] += x;
      bit[idx] = max(0LL, bit[idx]);
    }
  }
};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long T = 1, i, j;
  cin >> T;
  while (T--) {
    long long n, k;
    cin >> n >> k;
    if (prime(n) && k < n) {
      cout << n << endl;
      continue;
    }
    if (n % k == 0) {
      cout << n / k << endl;
    } else {
      bool flag = false;
      long long ans;
      for (i = 1; i * i <= n; i++) {
        if (n % i == 0) {
          if (i <= k) {
            ans = i;
          }
          if (n / i <= k) {
            flag = true;
            cout << i << endl;
            break;
          }
        }
      }
      if (!flag) {
        cout << n / ans << endl;
      }
    }
  }
  return 0;
}
