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 math
  
  n, m = map(int, input().split())
  r = m
  k = 0
  a = [
      2,
      3,
      5,
      7,
      11,
      13,
      17,
      19,
      23,
      29,
      31,
      37,
      41,
      43,
      47,
      53,
      59,
      61,
      67,
      71,
      73,
      79,
      83,
      89,
      97,
      101,
      103,
      107,
      109,
      113,
      127,
      131,
      137,
      139,
      149,
      151,
      157,
      163,
      167,
      173,
      179,
      181,
      191,
      193,
      197,
      199,
  ]
  for i in range(len(a)):
      if m % a[i] == 0 and m >= a[i]:
          r = m // a[i]
          break
  if r == m and m >= 199:
      r = m // 199
  if n > r:
      k = 1
  
  while n <= r:
      if m % n == 0:
          break
      n += 1
  if n == r + 1 or k == 1:
      print(1)
  else:
      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"}]