Buggy python submission (verdict: Time Limit Exceeded):
def is_prime(p):
    if p == 1:
        return False
    for i in range(2, int(p ** .5) + 1):
        if p % i == 0:
            return False
    return True


n, m = map(int, input().split())

if is_prime(m):
    print(1)
    exit()

ans = 0
for i in range(1, m // n + 1):
    if m % i == 0:
        ans = i

print(ans)

Fixed submission:
n, m = map(int, input().split())
ans = 1
for i in range(1, int(m ** .5) + 1):
    if m % i == 0:
        b = m // i
        if i * n <= m:
            ans = max(ans, i)
        if b * n <= m:
            ans = max(ans, b)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())

ans = 0
for i in range(1, m // n + 1):
    if m % i == 0:
        ans = i

print(ans)

Fixed submission:
n, m = map(int, input().split())
ans = 1
for i in range(1, int(m ** .5) + 1):
    if m % i == 0:
        b = m // i
        if i * n <= m:
            ans = max(ans, i)
        if b * n <= m:
            ans = max(ans, b)
print(ans)

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

Fixed submission:
n, m = map(int, input().split())
ans = 1
for i in range(1, int(m ** .5) + 1):
    if m % i == 0:
        b = m // i
        if i * n <= m:
            ans = max(ans, i)
        if b * n <= m:
            ans = max(ans, b)
print(ans)

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

Fixed submission:
n, m = map(int, input().split())
ans = 1
for i in range(1, int(m ** .5) + 1):
    if m % i == 0:
        b = m // i
        if i * n <= m:
            ans = max(ans, i)
        if b * n <= m:
            ans = max(ans, b)
print(ans)

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

Fixed submission:
n, m = map(int, input().split())
ans = 1
for i in range(1, int(m ** .5) + 1):
    if m % i == 0:
        b = m // i
        if i * n <= m:
            ans = max(ans, i)
        if b * n <= m:
            ans = max(ans, b)
print(ans)

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

Fixed submission:
n, m = map(int, input().split())
ans = 1
for i in range(1, int(m ** .5) + 1):
    if m % i == 0:
        b = m // i
        if i * n <= m:
            ans = max(ans, i)
        if b * n <= m:
            ans = max(ans, b)
print(ans)

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

Fixed submission:
n, m = map(int, input().split())
ans = 1
for i in range(1, int(m ** .5) + 1):
    if m % i == 0:
        b = m // i
        if i * n <= m:
            ans = max(ans, i)
        if b * n <= m:
            ans = max(ans, b)
print(ans)

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

Fixed submission:
n, m = map(int, input().split())
ans = 1
for i in range(1, int(m ** .5) + 1):
    if m % i == 0:
        b = m // i
        if i * n <= m:
            ans = max(ans, i)
        if b * n <= m:
            ans = max(ans, b)
print(ans)