import java.util.Arrays; import java.util.HashSet; import java.util.LinkedList; import java.util.Scanner; import java.util.Set; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); final int N = sc.nextInt(); long[] A = new long[N]; long[] B = new long[N]; for(int i = 0; i < N; i++){ A[i] = sc.nextLong(); B[i] = sc.nextLong(); } long lower = 0, upper = Integer.MAX_VALUE; while(lower + 1 < upper){ final long mid1 = lower + Math.max(1, (upper - lower) / 3); final long mid2 = upper - Math.max(1, (upper - lower) / 3); //System.out.println(lower + " " + mid1 + " " + mid2 + " " + upper); long mid1_max = Long.MIN_VALUE; long mid1_min = Long.MAX_VALUE; long mid2_max = Long.MIN_VALUE; long mid2_min = Long.MAX_VALUE; for(int i = 0; i < N; i++){ final long mid1_value = A[i] + B[i] * mid1; final long mid2_value = A[i] + B[i] * mid2; mid1_max = Math.max(mid1_max, mid1_value); mid1_min = Math.min(mid1_min, mid1_value); mid2_max = Math.max(mid2_max, mid2_value); mid2_min = Math.min(mid2_min, mid2_value); } final long mid1_answer = mid1_max - mid1_min; final long mid2_answer = mid2_max - mid2_min; //System.out.println(mid1_answer + " " + mid2_answer); if(mid1_answer <= mid2_answer){ upper = mid2; }else{ lower = mid1; } } System.out.println(upper); } }