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 \le i \le 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 \le t \le 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 \le n \le 10^9$) and $k$ ($1 \le k \le 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.

Difficulty: introductory

Starter code:

Solutions:
def read_int():
    return int(input())


def read_ints():
    return list(map(int, input().split(' ')))


t = read_int()
for case_num in range(t):
    n, k = read_ints()
    i = 1
    largest = 1
    while i * i <= n:
        if n % i == 0:
            if i <= k:
                largest = max(largest, i)
            if n // i <= k:
                largest = max(largest, n // i)
        i += 1
    print(n // largest)


def make_divisors(n: int) -> list:
    divisors = []
    for k in range(1, int(n ** 0.5) + 1):
        if n % k == 0:
            divisors.append(k)
            if k != n // k: 
                divisors.append(n // k)
    divisors = sorted(divisors)
    return divisors


t = int(input())
for _ in range(t):
    n, k = map(int, input().split())
    divs = make_divisors(n)
    ans = 10 ** 18
    for div in divs:
        if div <= k:
            ans = min(ans, n // div)
    print(ans)


import math

T = int(input())

for _ in range(T):
    n, k = list(map(int, input().split()))

    divs = set()
    for d in range(1, int(math.sqrt(n)) + 2):
        if n % d == 0:
            divs.add(d)
            divs.add(n // d)

    ans = 10**10
    for d in divs:
        if d > k:
            continue
        else:
            ans = min(ans, n // d)

    print(ans)


for _ in range(int(input())):
    n, k = list(map(int, input().split()))
    ar = []
    i = 1
    while i * i <= n:
        if n % i == 0:
            ar.append(i)
            ar.append(n // i)
        i += 1
    ar.sort()
    i = len(ar) - 1
    ans = n
    while i >= 0:
        if ar[i] <= k:
            ans = n // ar[i]
            break
        i -= 1
    print(ans)

import bisect
t=int(input())
for you in range(t):
    l=input().split()
    n=int(l[0])
    k=int(l[1])
    lfi=[]
    i=1
    maxa=1
    while(i*i<=n):
        if(n%i==0):
            lfi.append(i)
            if(i>maxa and i<=k):
                maxa=i
            if(i!=n//i):
                lfi.append(n//i)
                if(n//i>maxa and n//i<=k):
                    maxa=n//i
        i+=1
    print(n//maxa)


for _ in range(int(input())):
    n, k = list(map(int, input().split()))
    i = 1
    ans = n
    while i * i <= n:
        if n % i == 0:
            if i <= k:
                ans = min(ans, n // i)
            if n // i <= k:
                ans = min(ans, i)
        i += 1
    print(ans)


import sys
import heapq
import random
import collections

# available on Google, not available on Codeforces
# import numpy as np
# import scipy


from functools import reduce

def all_divisors(n):    
    return set(reduce(list.__add__, 
    ([i, n//i] for i in 
    range(1, int(n**0.5) + 1) if n % i == 0)))


def solve(n,k):  # fix inputs here
    lst = all_divisors(n)
    # print(lst)
    lst = sorted(list(lst))
    for i in lst[::-1]:
        if i <= k:
            return n//i
    return n






def console(*args):  # the judge will not read these print statement
    print('\033[36m', *args, '\033[0m', file=sys.stderr)
    return


for case_num in range(int(input())):
    # read line as a string
    # strr = input()

    # read line as an integer
    # _ = int(input())
    
    # read one line and parse each word as a string
    # lst = input().split()

    # read one line and parse each word as an integer
    # _,_ = list(map(int,input().split()))
    n,k = list(map(int,input().split()))

    # read matrix and parse as integers (after reading read nrows)
    # lst = list(map(int,input().split()))
    # nrows = lst[0]  # index containing information, please change
    # grid = []
    # for _ in range(nrows):
    #     grid.append(list(input()))

    res = solve(n,k)  # please change
    
    # Google - case number required
    # print("Case #{}: {}".format(case_num+1, res))

    # Codeforces - no case number required
    print(res)


import math

T = int(input())


def divs(n):
    d = []
    for i in range(1, math.ceil(math.sqrt(n))+1):
        if n % i == 0:
            d.extend([i, n//i])
    return sorted(d)

for t in range(T):
    N, K = [int(_) for _ in input().split()]
    for d in divs(N):
        if N / d <= K:
            print(d)
            break