#include using namespace std; namespace { typedef double real; typedef long long ll; template ostream& operator<<(ostream& os, const vector& vs) { if (vs.empty()) return os << "[]"; auto i = vs.begin(); os << "[" << *i; for (++i; i != vs.end(); ++i) os << " " << *i; return os << "]"; } template istream& operator>>(istream& is, vector& vs) { for (auto it = vs.begin(); it != vs.end(); it++) is >> *it; return is; } const ll INF = LLONG_MAX / 2LL; int N; vector A, B; void input() { cin >> N; A.resize(N); B.resize(N); for (int i = 0; i < N; i++) { cin >> A[i] >> B[i]; } } ll C(ll x) { ll m = INF; ll M = 0; for (int i = 0; i < N; i++) { m = min(m, A[i] + B[i] * x); M = max(M, A[i] + B[i] * x); } //cout << x << " -> " << M - m << endl; return M - m; } void solve() { if (N == 1) { cout << 0 << endl; return; } ll len = C(1); int t = 1; for (int i = 0; i < N; i++) { for (int j = i + 1; j < N; j++) { if (B[i] == B[j]) continue; real x = - (A[i] - A[j]) / real(B[i] - B[j]); if (x <= 0) continue; ll p = C(ll(floor(x))); if (len > p) { len = p; t = floor(x); } ll q = C(ll(ceil(x))); if (len > q) { len = q; t = ceil(x); } } } cout << t << endl; } } int main() { input(); solve(); return 0; }