CodeEff/ECCO huggingface dataset:
# Original solution
def main():
    N, M = (int(i) for i in input().split())

    def trial_division(n):
        divs = []
        for i in range(1, int(n**0.5)+1):
            if n % i == 0:
                divs.append(i)
                if i != n//i:
                    divs.append(n//i)
        divs.sort(reverse=True)
        return divs
    divs = trial_division(M)
    for d in divs:
        if d*N <= M:
            return print(d)


if __name__ == '__main__':
    main()


# Optimized solution
def main():
    def trial_division(n):
        divs = []
        for i in range(1, int(n**0.5)+1):
            if n % i == 0:
                divs.append(i)
                if i != n//i:
                    divs.append(n//i)
        divs.sort(reverse=True)
        return divs

    N, M = (int(i) for i in input().split())
    divs = trial_division(M)
    for d in divs:
        if N*d <= M:
            return print(d)


if __name__ == '__main__':
    main()
# Original solution
import math
(N, M) = list(map(int, input().split()))
TMPM = M

MAX_SQRT = int(math.sqrt(M))
prime_flag = [True] * (MAX_SQRT+1)
primes = []

prime_flag[0] = False
prime_flag[1] = False

for i in range(2, MAX_SQRT+1):
    mul = 2
    while True:
        p = i * mul
        if p > MAX_SQRT:
            break
        prime_flag[p] = False
        mul += 1

for i in range(2, MAX_SQRT+1):
    if prime_flag[i]:
        while M%i == 0:
            primes.append(i)
            M = int(M/i)

if M > 1:
    primes.append(M)


max_mul = 1
def Rec(primes, p, mul):
    global max_mul

    if TMPM//mul < N:
        return

    if p >= len(primes):
        if mul > max_mul:
            max_mul = mul
    else:
        Rec(primes, p+1, mul)
        Rec(primes, p+1, mul*primes[p])


Rec(primes, 0, 1)
print(max_mul)



# Optimized solution
import math
(N, M) = list(map(int, input().split()))

MAX_SQRT = int(math.sqrt(M))
prime_flag = [True] * (MAX_SQRT+1)
prime_dic = {}

prime_flag[0] = False
prime_flag[1] = False

for i in range(2, MAX_SQRT+1):
    mul = 2
    while True:
        p = i * mul
        if p > MAX_SQRT:
            break
        prime_flag[p] = False
        mul += 1

TMPM = M
for i in range(2, MAX_SQRT+1):
    if prime_flag[i]:
        while TMPM%i == 0:
            if i in prime_dic:
                prime_dic[i] += 1
            else:
                prime_dic[i] = 1
            TMPM = int(TMPM/i)

if TMPM > 1 or len(prime_dic) == 0:
    prime_dic[TMPM] = 1

max_mul = 1
def Rec(mul, p):
    global max_mul
    if M//mul < N:
        return

    if p >= len(prime_dic):
        if mul > max_mul:
            max_mul = mul
        return

    k = list(prime_dic.keys())[p]
    v = list(prime_dic.values())[p]
    for i in range(v+1):
        Rec(mul*(k**i), p+1)

Rec(1, 0)
print(max_mul)
# Original solution
ri = lambda: int(input())
rl = lambda: list(map(int,input().split()))
rr = lambda N: [ri() for _ in range(N)]
YN = lambda b: print('YES') if b else print('NO')
INF = 10**18

N,M=rl()

if M%N==0:
    print(M//N)
else:
    x = M//N
    ans = 1
    for i in range(x,0,-1):
        if M%i != 0:
            continue
        else:
            if M//i >= N:
                ans = i
                break
    
    print(ans)


# Optimized solution
ri = lambda: int(input())
rl = lambda: list(map(int,input().split()))
rr = lambda N: [ri() for _ in range(N)]
YN = lambda b: print('YES') if b else print('NO')
INF = 10**18

N,M=rl()

if M%N==0:
    print(M//N)
else:
    x = M//N
    ans = 1
    for i in range(x,0,-1):
        if M%i != 0:
            continue
        else:
            ans = i
            break
    print(ans)
# Original solution
N, M = list(map(int, input().split()))

if N == 1:
    print(M)

elif M % 2 == 1:
    if M // N % 2 == 0:
        if M % (M//N) == 0:
            if M / (M//N) >= N:
                print((M//N))

        else:
            for i in range(M//N - 1, 0, -2):
                if M % i == 0:
                    if M / i >= N:
                        print(i)
                        break
    else:
        for i in range(M//N, 0, -2):
            if M % i == 0:
                if M / i >= N:
                    print(i)
                    break
elif M % 3 != 0:
    for i in [x for x in range((M//N), 0, -1) if x % 3 != 0]:
        if M % i == 0:
            if M / i >= N:
                print(i)
                break
elif M % 5 != 0:
    for i in [x for x in range((M//N), 0, -1) if x % 5 != 0]:
        if M % i == 0:
            if M / i >= N:
                print(i)
                break
elif M % 7 != 0:
    for i in [x for x in range((M//N), 0, -1) if x % 7 != 0]:
        if M % i == 0:
            if M / i >= N:
                print(i)
                break

elif M % 11 != 0:
    for i in [x for x in range((M//N), 0, -1) if x % 11 != 0]:
        if M % i == 0:
            if M / i >= N:
                print(i)
                break

elif M % 13 != 0:
    for i in [x for x in range((M//N), 0, -1) if x % 13 != 0]:
        if M % i == 0:
            if M / i >= N:
                print(i)
                break
elif M % 17 != 0:
    for i in [x for x in range((M//N), 0, -1) if x % 17 != 0]:
        if M % i == 0:
            if M / i >= N:
                print(i)
                break
elif M % 23 != 0:
    for i in [x for x in range((M//N), 0, -1) if x % 23 != 0]:
        if M % i == 0:
            if M / i >= N:
                print(i)
                break
else:
    for i in range(M // N, 0, -1):
        if M % i == 0:
            if M / i >= N:
                print(i)
                break


# Optimized solution
N, M = list(map(int, input().split()))

if N == 1:
    print(M)

else:
    for i in range(max(int(M ** 0.5), M // N), 0, -1):
        if M % i == 0:
            if M / i >= N:
                print(i)
                break
# Original solution
# -*- coding: utf-8 -*-

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

for i in range(1, M // 2 + 1):
    if M % i == 0 and i >= N:
        print((M // i))
        exit()

print((1))


# Optimized solution
# -*- coding: utf-8 -*-

import bisect

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

y = [1, M]
for i in range(2, int(M ** 0.5) + 1):
    if M % i == 0:
        y.append(i)
        y.append(M // i)

y.sort()
print((M // y[bisect.bisect_left(y, N)]))
# Original solution
def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

[n,m] = [int(i) for i in input().split()]
if n == 1:
    print(m)
else:
    ans = -1
    #a1は高々この値
    a1_max = m // n
    for i in range(a1_max,0,-1):
        ls = make_divisors(i)
        if (m - i) % ls[-1] == 0 and (m - i)//ls[-1] >= (n-1):
            ans = max(ans,ls[-1])
    print(ans)


# Optimized solution
[n,m] = [int(i) for i in input().split()]
if n == 1:
    print(m)
else:
    ans = -1
    #a1は高々この値
    a1_max = m // n
    for i in range(a1_max,0,-1):
        if (m - i) % i == 0 and (m - i)//i >= (n-1):
            ans = max(ans,i)
    print(ans)
# Original solution
n,m=list(map(int,input().split()))
f1=[]
f2=[]
for i1 in range(1,int(m**0.5)+1):
    if m%i1==0:
        i2=m//i1
        if i1>=n:
            ans=i2
            break
        elif i2==n:
            ans=i1
            break
        elif i2<n:
            ans=f1[-1]
            break
        f1+=[i1]
        f2+=[i2]
else:
    ans=f1[-1]
print(ans)


# Optimized solution
n,m=list(map(int,input().split()))
for i1 in range(1,int(m**0.5)+1):
    if m%i1==0:
        i2=m//i1
        if i1>=n:
            ans=i2
            break
        elif i2==n:
            ans=i1
            break
        elif i2<n:
            ans=pre_i1
            break
        pre_i1=i1
else:
    ans=pre_i1
print(ans)
# Original solution
N,M = list(map(int,input().split()))

# 約数列挙
def enum_div(N):
    ret = []
    i = 1
    while True:
        if i**2 > N:
            break
        if N % i == 0:
            ret.append(i)
            if i**2 != N:
                ret.append(N / i)
        i += 1
    return ret

ans = 0
for i in enum_div(M):
    if i >= N:
        ans = max(ans,M / i)

print((int(ans)))

# Optimized solution
N,M = list(map(int,input().split()))

# 約数列挙
def enum_div(N):
    ret = []
    for i in range(1,int(N**0.5)+1):
        if N % i == 0:
            ret.append(i)
            if i**2 != N:
                ret.append(N // i)
        i += 1
    return ret

ans = 0
for i in enum_div(M):
    if i >= N:
        ans = max(ans,M // i)

print((int(ans)))
# Original solution
n,m=list(map(int,input().split()));print((next(v for v in range(m//n,-1,-1)if m%v<1)))

# Optimized solution
n,m=list(map(int,input().split()));print((next(v for v in range(m//n,-1,-1)if m%v==0)))
# Original solution
n,m=list(map(int,input().split()));print((next(v for v in range(m//n,-1,-1)if m%v==0)))

# Optimized solution
n,m=list(map(int,input().split()));print((next(v for v in range(m//n+1)[::-1]if m%v<1)))
# Original solution
from collections import deque

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

divisor = deque([])

for i in range(2, M + 1) :
    if M % i == 0 :
        divisor.append(i)
    if i * N > M :
        break

while divisor :
    div = divisor.pop()
    if M // div >= N :
        print(div)
        break
else :
    print((1))


# Optimized solution
N, M = list(map(int, input().split()))

def divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    divisors.sort(reverse=True)
    return divisors

div = divisors(M)

for d in div :
    if M >= N * d :
        print(d)
        break
# Original solution
import sys
import collections
from math import ceil
ma = lambda : list(map(int,input().split()))
ni = lambda : int(eval(input()))

n,m = ma()
gcd = 1
for d in range(1,m//n+1):
    q,r = divmod(m,d)
    if r == 0 and q>=n:gcd = d
print(gcd)


# Optimized solution
import sys
import collections
from math import ceil
ma = lambda : list(map(int,input().split()))
ni = lambda : int(eval(input()))
def divisor(n):
    d = []
    for i in range(1,int(n**0.5)+1):
        if n%i == 0:
            d.append(i)
            if i != n//i:
                d.append(n//i)
    #d.sort()
    return d
n,m = ma()
gcd = 1
D = divisor(m)
for d in D:
    q,r = divmod(m,d)
    if q>=n and r==0:gcd = max(gcd,d)
print(gcd)
# Original solution
N,M = list(map(int,input().split()))

tmp = M//N
ans = 0
for i in range(1,tmp+1):
    if M%i==0:
        ans = i
print(ans)

# Optimized solution
N,M = list(map(int,input().split()))

tmp = M//N
ans = 0
for i in range(tmp,-1,-1):
    if M%i==0:
        ans = i
        break
print(ans)
# Original solution
import sys
input = sys.stdin.readline
from math import sqrt
from bisect import bisect_right

def main():
	n, m = list(map(int, input().strip().split()))
	M = int(sqrt(m))
	l = []
	for i in range(1, M+1):
		if m % i == 0:
			l.append(i)
			l.append(m // i)
	l.sort()
	k = m//n
	ind = bisect_right(l, k)
	# print(l)
	print((l[ind-1]))

if __name__ == '__main__':
	main()


# Optimized solution
import sys
input = sys.stdin.readline
from math import sqrt
from bisect import bisect_right

def main():
	n, m = list(map(int, input().strip().split()))
	M = int(sqrt(m))
	ans = 1
	for i in range(1, M+1):
		if m % i == 0:
			if i*n <= m:
				ans = max(ans, i)
			if m//i * n <= m:
				ans = max(ans, m//i)
	print(ans)

if __name__ == '__main__':
	main()
# Original solution
n,m=list(map(int,input().split()))
for i in range(n,m+1):
  if m%i==0:
    print((m//i))
    exit()
    

# Optimized solution
n,m=list(map(int,input().split()))
for i in range(n,10**8):
  if m%i==0:
    print((m//i))
    exit()
print((1))
# Original solution
N, M = list(map(int, input().split()))


def factorize(n):
    if n == 1:
        return [1]

    i, factors = 2, []
    while i * i <= n:
        while n % i == 0:
            n //= i
            factors.append(i)
        i += 1
    if n > 1:
        factors.append(n)
    return factors


factors = factorize(M)
n_factors = len(factors)

ans = 0
for i in range(1 << n_factors):
    x = 1
    for j in range(n_factors):
        if i & (1 << j):
            x *= factors[j]
    y = M // x
    if N <= y:
        ans = max(ans, x)
print(ans)


# Optimized solution
from collections import Counter

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


def factorize(n):
    if n == 1:
        return [1]

    i, factors = 2, []
    while i * i <= n:
        while n % i == 0:
            n //= i
            factors.append(i)
        i += 1
    if n > 1:
        factors.append(n)
    return factors


c = Counter(factorize(M))
a = [1]
for k, v in list(c.items()):
    tmp = []
    for x in a:
        for i in range(v + 1):
            tmp.append(x * (k**i))
    a = list(set(a) | set(tmp))

ans = 0
for x in a:
    y = M // x
    if N <= y:
        ans = max(ans, x)
print(ans)
# Original solution
from collections import Counter

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


def factorize(n):
    if n == 1:
        return [1]

    i, factors = 2, []
    while i * i <= n:
        while n % i == 0:
            n //= i
            factors.append(i)
        i += 1
    if n > 1:
        factors.append(n)
    return factors


c = Counter(factorize(M))
a = [1]
for k, v in list(c.items()):
    tmp = []
    for x in a:
        for i in range(v + 1):
            tmp.append(x * (k**i))
    a = list(set(a) | set(tmp))

ans = 0
for x in a:
    y = M // x
    if N <= y:
        ans = max(ans, x)
print(ans)


# Optimized solution
N, M = list(map(int, input().split()))


def make_divisors(n):
    i, divisors = 1, []
    while i * i <= n:
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n // i)
        i += 1
    return divisors


ans = 0
for x in make_divisors(M):
    if N <= M // x:
        ans = max(ans, x)
print(ans)
# Original solution
N, M = list(map(int, input().split()))


def make_divisor_list(num, N):

    if num < 1:
        return 0
    elif num == 1:
        return 1
    else:
        max_num = 1
        for i in range(2, num // N + 1):
            if num % i == 0:
                # 割り切れる=約数
                if num / i >= N:
                    max_num = i
                else:
                    break
        return max_num

print((make_divisor_list(M, N)))

# Optimized solution
N, M = list(map(int, input().split()))

def make_divisor_list(num, N):

    if num < 1:
        return 0
    elif num == 1:
        return 1
    else:
        max_num = 1
        for i in reversed(list(range(2, num // N + 1))):
            if num % i == 0:
                # 割り切れる=約数
                if num / i >= N:
                    max_num = i
                    break
                #else:
                #    break
        return max_num

print((make_divisor_list(M, N)))
# Original solution
N, M = list(map(int, input().split()))

for i in range(M // N, 0, -1):
  if M % i == 0:
    print(i)
    exit()

# Optimized solution
def main():
  N, M = list(map(int, input().split()))

  for i in range(M // N, 0, -1):
    if M % i == 0:
      print(i)
      break
      
if __name__ == '__main__':
  main()
# Original solution
n, m = list(map(int, input().split()))


def divisor(num):
    opside = num
    i = 2
    div = [1, opside]
    while i <= opside:
        if num % i == 0:
            opside = num // i
            if i == opside:
                div.append(i)
            elif opside <= i:
                break
            else:
                div.append(i)
                div.append(opside)
        i += 1
    div.sort()
    return div


ans = 0
for i in divisor(m):
    if n <= m // i:
        ans = i
    else:
        break
print(ans)

# Optimized solution
n, m = list(map(int, input().split()))


def divisor(n):
    divisors = []
    for i in range(1, int(n ** 0.5) + 1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n // i)
    divisors.sort()
    return divisors


ans = 0
for i in divisor(m):
    if n <= m // i:
        ans = i
    else:
        break
print(ans)
# Original solution
N,M=list(map(int,input().split()))

ans=0
for i in range(1,M//N+1):
    if M%i==0:
        ans=max(ans,i)
        
print(ans)

# Optimized solution
N,M=list(map(int,input().split()))

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors

ans=0
table=make_divisors(M)
table.sort()

for i in table:
    if i<=M//N:
        ans=i
        
print(ans)
# Original solution
import math
N, M = [int(i) for i in input().split()]
for i in range(math.ceil(M/N), 0, -1):
  if M % i == 0:
    print(i)
    break


# Optimized solution
import math
N, M = [int(i) for i in input().split()]
for i in range(M//N, 0, -1):
  if M % i == 0:
    print(i)
    break
# Original solution
n,m=list(map(int,input().split()))
a=m//n
ans=1
for i in range(1,a+1):
    if m%i==0:
        ans=max(ans,i)
print(ans)


# Optimized solution
import sys
n,m=list(map(int,input().split()))
a=m//n
ans=1
if m%n==0:
  print((int(m//n)))
  sys.exit()
for i in range(1,a+1):
    if m%i==0:
        ans=max(ans,i)
print(ans)
# Original solution
import sys

#+++++
		
def main():
	n,m = list(map(int, input().split()))
	if n == 1:
		return m
	
	ret = 0
	for i in range(1,m):
		a = m // i
		b = m % i
		if b == 0 and n*i <= m:
			ret = i
			
		if n*i > m:
			return ret
			
		if ret == 1 and i*i > m:
			return 1
			
	print(ret)
	
	
#+++++
isTest=False

def pa(v):
	if isTest:
		print(v)

if __name__ == "__main__":
	if sys.platform =='ios':
		sys.stdin=open('inputFile.txt')
		isTest=True
	else:
		pass
		#input = sys.stdin.readline
			
	ret = main()
	if ret is not None:
		print(ret)

# Optimized solution
import sys
import math

#+++++


		
def main():
	n,m = list(map(int, input().split()))
	if m % n ==0:
		return m // n
		
	ll=1
	for i in range(1, int(math.sqrt(m))+1):
		#pa((i,ll))
		if m % i == 0:
			if i >= n:
				ll=max(ll, m // i)
			if m // i >= n:
				ll=max(ll, i)
	return ll
				

#+++++
isTest=False

def pa(v):
	if isTest:
		print(v)

if __name__ == "__main__":
	if sys.platform =='ios':
		sys.stdin=open('inputFile.txt')
		isTest=True
	else:
		pass
		#input = sys.stdin.readline
			
	ret = main()
	if ret is not None:
		print(ret)
# Original solution
def make_divisors(n,m):
    divisors = []
    for i in range(1, (m//n)+1):
        if m % i == 0:
            divisors.append(i)
            if i != m // i and m//i<=m//n:
                divisors.append(m//i)
    return divisors
n,m=list(map(int,input().split()))
print((max(make_divisors(n,m))))


# Optimized solution
def make_divisors(n,m):
    divisors = []
    for i in range(1,min(int(m**(1/2))+1,int(m//n)+1)):
      if m % i == 0:
          divisors.append(i)
          if i != m // i and m//i<=m//n:
              divisors.append(m//i)
    return divisors
n,m=list(map(int,input().split()))
print((max(make_divisors(n,m))))
# Original solution
def make_divisors(n,m):
    divisors = []
    for i in range(1,min(int(m**(1/2))+1,int(m//n)+1)):
      if m % i == 0:
          divisors.append(i)
          if i != m // i and m//i<=m//n:
              divisors.append(m//i)
    return divisors
n,m=list(map(int,input().split()))
print((max(make_divisors(n,m))))



# Optimized solution
n,m=list(map(int,input().split()))
def yak1(n,m):
  l=[]
  for i in range(1,min(int((m)**(1/2))+1,(m//n)+1)):
    if m%i==0:
      l.append(i)
      if m//i!=i and m//i<=m//n:
        l.append(m//i)
  return l
print((max(yak1(n,m))))
# Original solution
import bisect
n, m = list(map(int, input().split()))

fct = []
fct2 = []
sq = int(m**(1/2))
if sq + 1 ==m:
    sq += 1

for f in range(1, sq + 1):
    if m%f == 0:
        fct.append(f)
        fct2.append(m//f)
if fct2[-1] == fct[-1]:
    fct2.pop()

fct2.reverse()

fct += fct2

k = m//n
ind = bisect.bisect_left(fct,k)

print((fct[ind-1] if k<fct[ind] else fct[ind]))

# Optimized solution
import bisect
n,m = list(map(int, input().split( )))

t = m//n

fct_sup = int(m**(1/2)) + 1

fct = []
fct2 = []
for f in range(1,fct_sup+1):
    if m%f == 0:
        fct.append(f)
        fct2.append(m//f)
if fct[-1] == fct2[-1]:
    fct.pop()
fct2.reverse()
fct += fct2
i = bisect.bisect_right(fct,t)
print((fct[i-1]))
# Original solution
n, m = list(map(int, input().split()))
d = m//n+1
for x in range(d)[::-1]:
  if m%x==0:
    break
print(x)

# Optimized solution
N, M = list(map(int, input().split(" ")))
def solv(N, M):
    d = M//N
    for i in range(d+1)[::-1]:
        if M%i == 0:
            return i
print((solv(N, M)))
# Original solution
import sys
from io import StringIO
import unittest
import os

# 再帰処理上限(dfs作成時に設定するのが面倒なので限度近い値を組み込む)
sys.setrecursionlimit(999999999)


# 実装を行う関数
def resolve(test_def_name=""):
    n, m = list(map(int, input().split()))

    ans = []

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

    print((max(ans)))


# テストクラス
class TestClass(unittest.TestCase):
    def assertIO(self, assert_input, output):
        stdout, sat_in = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(assert_input)
        resolve(sys._getframe().f_back.f_code.co_name)
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, sat_in
        self.assertEqual(out, output)

    def test_input_1(self):
        test_input = """3 14"""
        output = """2"""
        self.assertIO(test_input, output)

    def test_input_2(self):
        test_input = """10 123"""
        output = """3"""
        self.assertIO(test_input, output)

    def test_input_3(self):
        test_input = """100000 1000000000"""
        output = """10000"""
        self.assertIO(test_input, output)

    # 自作テストパターンのひな形(利用時は「tes_t」のアンダーバーを削除すること
    def tes_t_1original_1(self):
        test_input = """データ"""
        output = """データ"""
        self.assertIO(test_input, output)


# 実装orテストの呼び出し
if __name__ == "__main__":
    if os.environ.get("USERNAME") is None:
        # AtCoder提出時の場合
        resolve()

    else:
        # 自PCの場合
        unittest.main()


# Optimized solution
import sys
from io import StringIO
import unittest
import os

# 再帰処理上限(dfs作成時に設定するのが面倒なので限度近い値を組み込む)
sys.setrecursionlimit(999999999)


# 実装を行う関数
def resolve(test_def_name=""):
    n, m = list(map(int, input().split()))

    for i in reversed(list(range(1, m // n + 1))):
        if (m - i * n) % i == 0:
            print(i)
            return




# テストクラス
class TestClass(unittest.TestCase):
    def assertIO(self, assert_input, output):
        stdout, sat_in = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(assert_input)
        resolve(sys._getframe().f_back.f_code.co_name)
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, sat_in
        self.assertEqual(out, output)

    def test_input_1(self):
        test_input = """3 14"""
        output = """2"""
        self.assertIO(test_input, output)

    def test_input_2(self):
        test_input = """10 123"""
        output = """3"""
        self.assertIO(test_input, output)

    def test_input_3(self):
        test_input = """100000 1000000000"""
        output = """10000"""
        self.assertIO(test_input, output)

    # 自作テストパターンのひな形(利用時は「tes_t」のアンダーバーを削除すること
    def tes_t_1original_1(self):
        test_input = """データ"""
        output = """データ"""
        self.assertIO(test_input, output)


# 実装orテストの呼び出し
if __name__ == "__main__":
    if os.environ.get("USERNAME") is None:
        # AtCoder提出時の場合
        resolve()

    else:
        # 自PCの場合
        unittest.main()