n = int(input())
if n == 1:
    print(0)
    exit()
A = [0] * n
B = [0] * n
for i in range(n):
    B[i], A[i] = map(int, input().split())

mi = [None] * n
ma = [None] * n
for i in range(n):
    l = 1
    r = 1 << 60
    for j in range(n):
        if i == j:
            continue
        if A[i] == A[j]:
            if B[i] > B[j]:
                r = -1
                break
        elif A[i] > A[j]:
            r = min(r, (B[j] - B[i]) // (A[i] - A[j]))
        else:
            db = B[i] - B[j]
            da = A[j] - A[i]
            l = max(l, (db + da - 1) // da)

    if l <= r:
        mi[i] = (l, r)

    l = 1
    r = 1 << 60
    for j in range(n):
        if i == j:
            continue
        if A[i] == A[j]:
            if B[i] < B[j]:
                r = -1
                break
        elif A[i] > A[j]:
            da = A[i] - A[j]
            db = B[j] - B[i]
            l = max(l, (db + da - 1) // da)
        else:
            r = min(r, (B[i] - B[j]) // (A[j] - A[i]))

    if l <= r:
        ma[i] = (l, r)


ans = 1 << 60
x = 1 << 60
for i in range(n):
    if mi[i] is None:
        continue

    l1, r1 = mi[i]
    for j in range(n):
        if i == j or ma[j] is None:
            continue

        l2, r2 = ma[j]

        cand = []

        if l1 <= r2 <= r1:
            cand.append(r2)
        if l1 <= l2 <= r1:
            cand.append(l2)
        if l2 <= l1 <= r2:
            cand.append(l1)
        if l2 <= r1 <= r2:
            cand.append(r1)

        for c in cand:
            ma_ = A[j] * c + B[j]
            mi_ = A[i] * c + B[i]
            if ma_ - mi_ < ans:
                ans = ma_ - mi_
                x = c
            elif ma_ - mi_ == ans and c < x:
                x = c


print(x)