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: N,M=map(int,input().split())
  if M%N==0:
    print(M//N)
  else:
    s=M//N
    if s<100000:
      ans=1
      while s!=1:
        if M%s==0:
          ans=s
          break
        s-=1
      print(ans)
    else:
      rM=M**(1/2)
      s=N
      ans=1
      while s<=rM:
        if M%s==0:
          ans=M//s
          break
        s+=1
      else:
        s=N
        while s!=1:
        if M%s==0:
          ans=s
          break
        s-=1
      print(ans)
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"}]