Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
def is_prime(q):
    q = abs(q)
    if q == 2: return True
    if q < 2 or q&1 == 0: return False
    return pow(2, q-1, q) == 1
if is_prime(m):
    print(1)
else:
    for i in range(m//n, 0, -1):
        if not m%i:
            print(i)
            break

Fixed submission:
n, m = map(int, input().split())
def is_prime(q):
    q = abs(q)
    if q == 2: return True
    if q < 2 or q&1 == 0: return False
    return pow(2, q-1, q) == 1
if is_prime(m):
    print(1)
else:
    for i in range(m//n, 0, -1):
        if not m%i:
            print(i)
            break

Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
if m%2:
    if m//n % 2:
        for i in range(m//n, 0, -2):
            if not m%i:
                print(i)
                break
    else:
        for i in range(m//n+1, 0, -2):
            if not m%i:
                print(i)
                break
else:
    for i in range(m//n, 0, -1):
        if not m%i:
            print(i)
            break

Fixed submission:
n, m = map(int, input().split())
def is_prime(q):
    q = abs(q)
    if q == 2: return True
    if q < 2 or q&1 == 0: return False
    return pow(2, q-1, q) == 1
if is_prime(m):
    print(1)
else:
    for i in range(m//n, 0, -1):
        if not m%i:
            print(i)
            break

Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
if m%2:
    for i in range(m//n, 0, -2):
    if not m%i:
        print(i)
        break
else:
    for i in range(m//n, 0, -1):
        if not m%i:
            print(i)
            break

Fixed submission:
n, m = map(int, input().split())
def is_prime(q):
    q = abs(q)
    if q == 2: return True
    if q < 2 or q&1 == 0: return False
    return pow(2, q-1, q) == 1
if is_prime(m):
    print(1)
else:
    for i in range(m//n, 0, -1):
        if not m%i:
            print(i)
            break

Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
for i in range(m//n, 0, -1):
    if not m%i:
        print(i)
        break

Fixed submission:
n, m = map(int, input().split())
def is_prime(q):
    q = abs(q)
    if q == 2: return True
    if q < 2 or q&1 == 0: return False
    return pow(2, q-1, q) == 1
if is_prime(m):
    print(1)
else:
    for i in range(m//n, 0, -1):
        if not m%i:
            print(i)
            break

Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
ans = max([i for i in range(1, m//n+1) if not m%i])
print(ans)


Fixed submission:
n, m = map(int, input().split())
def is_prime(q):
    q = abs(q)
    if q == 2: return True
    if q < 2 or q&1 == 0: return False
    return pow(2, q-1, q) == 1
if is_prime(m):
    print(1)
else:
    for i in range(m//n, 0, -1):
        if not m%i:
            print(i)
            break

Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
ans = 0
for i in range(1, m//n+1):
    if not m%i:
        ans = i
print(ans)

Fixed submission:
n, m = map(int, input().split())
def is_prime(q):
    q = abs(q)
    if q == 2: return True
    if q < 2 or q&1 == 0: return False
    return pow(2, q-1, q) == 1
if is_prime(m):
    print(1)
else:
    for i in range(m//n, 0, -1):
        if not m%i:
            print(i)
            break