#include #include #include #include #include using namespace std; using ll=long long; using vll=vector; void min_u(ll&m, ll v) { if(m<0 || m>v) { m=v; } } ll search(vll& u, ll ve) { int s=0, e=u.size()-1, c, r=0; while(s<=e) { c=(s+e)/2; ll d=u[c]+ve; //printf("s=%d e=%d c=%d d=%lld ve=%lld\n", s, e, c, d, ve); if(d==0) return 0; if(d>0) { e=c-1; r=c-1; } else { s=c+1; r=c; } } if(r<0) r=0; ll ret=llabs(u[r]+ve); if(r+1 u, v; vll s; for(int i=0;i