N,T  = list(map(int,input().split()))

d = int(T / N)

def ans():

    for i in range(d+1,0,-1):    

            if T % i ==0:

                print(i)

                break

if T % N == 0:

    print (d)

else:

    ans()
import math

N,T  = list(map(int,input().split()))

#d = int(T / N)

m = []



def ans():

    ans = 1

    for i in range(1,int(math.sqrt(T))):    

            if T % i ==0:

                m.append(i)

                m.append(T//i)

    for p in m:

        if p <= T // N:

            ans = max(ans,p)

    print (ans)

    

if T % N == 0:

    print((int(T / N)))

else:

    ans()
N, T = list(map(int, input().split()))
d = int(T / N)


def ans():
    for i in range(d + 1, 0, -1):
        if T % i == 0:
            print(i)
            break


if T % N == 0:
    print(d)
else:
    ans()

import math

N, T = list(map(int, input().split()))
# d = int(T / N)
m = []


def ans():
    ans = 1
    for i in range(1, int(math.sqrt(T))):
        if T % i == 0:
            m.append(i)
            m.append(T // i)
    for p in m:
        if p <= T // N:
            ans = max(ans, p)
    print(ans)


if T % N == 0:
    print((int(T / N)))
else:
    ans()

+import math + -d = int(T / N) +# d = int(T / N) +m = [] -    for i in range(d + 1, 0, -1): +    ans = 1 +    for i in range(1, int(math.sqrt(T))): -            print(i) -            break +            m.append(i) +            m.append(T // i) +    for p in m: +        if p <= T // N: +            ans = max(ans, p) +    print(ans) -    print(d) +    print((int(T / N)))