human
Write me a Python program to find the maximum possible value of the greatest common divisor of a_1, a_2, given the following:
I found an interesting problem on https://atcoder.jp/contests/abc112/tasks/abc112_d:
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.

-----Constraints-----
 - All values in input are integers.
 - 1 \leq N \leq 10^5
 - N \leq M \leq 10^9

-----Input-----
Input is given from Standard Input in the following format:
N M

-----Output-----
Print the maximum possible value of the greatest common divisor of a sequence a_1, a_2, ..., a_N that satisfies the condition.

-----Sample Input-----
3 14

-----Sample Output-----
2

Consider the sequence (a_1, a_2, a_3) = (2, 4, 8). Their greatest common divisor is 2, and this is the maximum value.

I tried it in Python, but could not do it. Can you solve it?
assistant
#Here is Python program to find the maximum possible value of the greatest common divisor of a_1, a_2, .

def resolve():
    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(reverse=True)
        return divisors

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

    div = make_divisors(M)
    for d in div:
        if d <= M // N:
            print(d)
            break

def __starting_point():
    resolve()

__starting_point()