def pgcd(a, b):
    """
    return the best page size for a given limited query

    :param a: the start offset
    :param b: the end offset
    :return:

    >>> pgcd(30, 40)
    10

    >>> pgcd(7, 13)
    1

    """
    while a % b != 0:
        a, b = b, a % b
    return b