#include using namespace std; using Int = long long; template inline void chmin(T1 &a,T2 b){if(a>b) a=b;} template inline void chmax(T1 &a,T2 b){if(a>n; vector a(n),b(n); for(Int i=0;i>a[i]>>b[i]; const Int INF = 1e18; using P = pair; P ans(INF,-1); auto calc= [&](Int x){ Int c1,c2,d1,d2; c1=c2=INF; d1=d2=-INF; for(Int i=0;i>1; if(calc(m)<0) l=m; else r=m; } for(Int i=l-10;i