#include using namespace std; #define rep(i,n) for(int i=0;i=0;--i) #define debug(output) if(debugFlag)cout<<#output<<"= "< P; const bool debugFlag=true; const lint linf=1.1e18;const int inf=1.01e9; constexpr int MOD=1000000007; templatebool chmax(T &a, const T &b) { if(a < b){ a = b; return 1; } return 0; } templatebool chmin(T &a, const T &b) { if(a > b){ a = b; return 1; } return 0; } template class SegTree{ int n; vector node; T e; function operation; function update; public: SegTree(int _n,T _e,function _operation,function _update):n(_n),e(_e),operation(_operation),update(_update){node.resize(n*2,e);} void change(int i,T x){ i+=n; node[i]=update(node[i],x); while(i>1){ i>>=1; node[i]=operation(node[i<<1|0],node[i<<1|1]); } } T get(int l,int r){ T a=e; T b=e; l+=n;r+=n; while(l>=1;r>>=1; } return operation(a,b); } void input(vector& _input){ for(int i=0;i>n; vector a(n),b(n); rep(i,n)cin>>a[i]; rep(i,n)cin>>b[i]; a.push_back(inf);b.push_back(linf); auto op=[](lint x,lint y){return max(x,y);}; SegTree x(n+1,-linf,op,op); auto y=x; rep(i,n+1){ x.change(i,a[i]-b[i]); y.change(i,a[i]+b[i]); } auto judge=[&](lint l,lint r)->bool{ return x.get(l,r)