#!/usr/bin/env python # -*- coding: utf-8 -*- from math import ceil from math import floor def f(x): max_f = -1 min_f = 10**20 for a,b in AB: max_f = max(max_f, a + b * x) min_f = min(min_f, a + b * x) return max_f - min_f N = int(input()) AB = [list(map(int,input().split())) for i in range(0,N)] left = 1 right = 10**10 eps = 1e-6 for i in range(100): y1 = f((left * 2 + right)/3) y2 = f((left+ right * 2)/3) if y1 <= y2 + eps: right = (left + right * 2)/3 else: left = (left * 2 + right)/3 if f(ceil(left)) < f(floor(left)): c = ceil(left) else: c = floor(left) ans = 0 min_f = 10**20 for i in range(max(1,c - 30), min(c + 31, 10**9 + 1)): if f(i) < min_f: ans = i min_f = f(i) print(ans)