output_description: Print the maximum possible value of the greatest common divisor of a sequence
  a_1, a_2, ..., a_N that satisfies the condition.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N M
attempt: import sys, re
  from collections import deque, defaultdict, Counter
  from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2, gcd
  from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
  from operator import itemgetter, mul
  from copy import deepcopy
  from string import ascii_lowercase, ascii_uppercase, digits
  from bisect import bisect, bisect_left, insort, insort_left
  from heapq import heappush, heappop
  from functools import reduce
  def input(): return sys.stdin.readline().strip()
  def INT(): return int(input())
  def MAP(): return map(int, input().split())
  def LIST(): return list(map(str, input().split()))
  def ZIP(n): return zip(*(MAP() for _ in range(n)))
  sys.setrecursionlimit(10 ** 9)
  INF = float('inf')
  mod = 10 ** 9 + 7
  #import numpy as np
  from decimal import *
   
  # N以上でMを割り切ることができる最小の数nを求める　→ 答え M//n
  N, M = MAP()
  
  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
      
  divisors = make_divisors(M)
  print(divisors)n = divisors[bisect_left(divisors, N)]
  print(M//n)
  
problem_description: Statement
  
  You are given integers N and M.
  
  Consider a sequence a of length N consisting of positive integers such that
  a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest
  common divisor of a_1, a_2, ..., a_N.
samples: [{"input": "3 14", "output": "2\n    \n\nConsider the sequence (a_1, a_2, a_3) = (2, 4, 8). Their greatest common\ndivisor is 2, and this is the maximum value.\n\n* * *"}, {"input": "10 123", "output": "3\n    \n\n* * *"}, {"input": "100000 1000000000", "output": "10000"}]