#include using namespace std; const int MOD=1e9+7; const int INF=1e9; //const int MOD=998244353; const long long LINF=1e18; #define int long long //template //main signed main(){ int N,K;cin>>N>>K; std::vector x(N+2),a(N+2); for(int i=0;i>x[i+1]; for(int i=0;i>a[i+1]; x[0]=-LINF;x[N+1]=LINF;a[0]=a[N+1]=0; int rnow=K,lnow=K;//声を出した右端と左端 int left=x[K]-a[K],right=x[K]+a[K]; bool f=true; while(f){ f=false; if(x[rnow+1]<=right){ rnow++; right=max(right,x[rnow]+a[rnow]); left=min(left,x[rnow]-a[rnow]); f=true; } if(x[lnow-1]>=left){ lnow--; right=max(right,x[lnow]+a[lnow]); left=min(left,x[lnow]-a[lnow]); f=true; } } cout<