Buggy python submission (verdict: Runtime Error):
import math

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

x=0

s = []
for i in range(math.sqrt(m)):
	if m%i==0:
		s.append(i)



for i in s:
	if m%(i+1)==0 and m//(i+1)>n-1:
		x=max(x,i+1)
print(x)







Fixed submission:
import math

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

x=0

s = []
for i in range(math.floor(math.sqrt(m))+3):
	if m%(i+1)==0:
		s.append(i+1)
		s.append(m//(i+1))




for i in s:
	if m%(i)==0 and m//(i)>n-1:
		x=max(x,i)
print(x)

Buggy python submission (verdict: Time Limit Exceeded):
import math

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

x=0
if n<math.sqrt(m):
	for i in range(m//n):
		if m%(i+1)==0 and m//(i+1)>n-1:
			x=max(x,i+1)
	print(x)
else:
	for i in range(math.floor(math.sqrt(m))):
		if m%(i+1)==0 and m//(i+1)>n-1:
			x=max(x,i+1)
	print(x)



Fixed submission:
import math

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

x=0

s = []
for i in range(math.floor(math.sqrt(m))+3):
	if m%(i+1)==0:
		s.append(i+1)
		s.append(m//(i+1))




for i in s:
	if m%(i)==0 and m//(i)>n-1:
		x=max(x,i)
print(x)

Buggy python submission (verdict: Runtime Error):
import math

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

x=0

s = []
for i in range(math.floor(math.sqrt(m)))
	if m%i==0:
		s.append(i)



for i in s
	if m%(i+1)==0 and m//(i+1)>n-1:
		x=max(x,i+1)
print(x)





Fixed submission:
import math

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

x=0

s = []
for i in range(math.floor(math.sqrt(m))+3):
	if m%(i+1)==0:
		s.append(i+1)
		s.append(m//(i+1))




for i in s:
	if m%(i)==0 and m//(i)>n-1:
		x=max(x,i)
print(x)

Buggy python submission (verdict: Runtime Error):
import math

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

x=0

s = []
for i in range(math.sqrt(m))
	if m%i==0:
		s.append(i)



for i in s
	if m%(i+1)==0 and m//(i+1)>n-1:
		x=max(x,i+1)
print(x)





Fixed submission:
import math

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

x=0

s = []
for i in range(math.floor(math.sqrt(m))+3):
	if m%(i+1)==0:
		s.append(i+1)
		s.append(m//(i+1))




for i in s:
	if m%(i)==0 and m//(i)>n-1:
		x=max(x,i)
print(x)

Buggy python submission (verdict: Time Limit Exceeded):
import math

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

x=0
if n<math.sqrt(m):
	for i in range(m//n):
		if m%(i+1)==0 and m//(i+1)>n-1:
			x=max(x,i+1)
	print(x)
else:
	for i in range(math.floor(math.sqrt(m))):
		if m%(i+1)==0 and m//(i+1)>n-1:
			x=max(x,i+1)
	print(x)



Fixed submission:
import math

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

x=0

s = []
for i in range(math.floor(math.sqrt(m))+3):
	if m%(i+1)==0:
		s.append(i+1)
		s.append(m//(i+1))




for i in s:
	if m%(i)==0 and m//(i)>n-1:
		x=max(x,i)
print(x)

Buggy python submission (verdict: Runtime Error):
import math

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

x=0
if n<math.sqrt(m):
	for i in range(m//n):
		if m%(i+1)==0 and m//(i+1)>n-1:
			x=max(x,i+1)
	print(x)
else:
	for i in range(math.floor(math,sqrt(m))):
		if m%(i+1)==0 and m//(i+1)>n-1:
			x=max(x,i+1)
	print(x)



Fixed submission:
import math

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

x=0

s = []
for i in range(math.floor(math.sqrt(m))+3):
	if m%(i+1)==0:
		s.append(i+1)
		s.append(m//(i+1))




for i in s:
	if m%(i)==0 and m//(i)>n-1:
		x=max(x,i)
print(x)

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

x=0

for i in range(m//n):
	if m%(i+1)==0 and m//(i+1)>n-1:
		x=max(x,i+1)
print(x)




Fixed submission:
import math

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

x=0

s = []
for i in range(math.floor(math.sqrt(m))+3):
	if m%(i+1)==0:
		s.append(i+1)
		s.append(m//(i+1))




for i in s:
	if m%(i)==0 and m//(i)>n-1:
		x=max(x,i)
print(x)

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

x=0

for i in range(m):
	if m%(i+1)==0 and m//(i+1)>n-1:
		x=max(x,i+1)
print(x)




Fixed submission:
import math

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

x=0

s = []
for i in range(math.floor(math.sqrt(m))+3):
	if m%(i+1)==0:
		s.append(i+1)
		s.append(m//(i+1))




for i in s:
	if m%(i)==0 and m//(i)>n-1:
		x=max(x,i)
print(x)