#define _USE_MATH_DEFINES #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define int long long int N,A[1000],B[1000]; int latte(int c){ int mi = LLONG_MAX, ma = LLONG_MIN; for(int i=0;i>N; for(int i=0;i>A[i]>>B[i]; int l = 0, r = 1e9; //printf("%lld\n",latte(0)); return 0; while(true){ int c1 = (l*2+r)/3, c2 = (l+r*2)/3; if(c2-c1<=1){ l = c1; r = c2; break; } int r1 = latte(c1), r2 = latte(c2); if(r1>r2) r = c2; else if(r1latte(r))?l:r); return 0; }