#pragma GCC optimize("Ofast") #pragma GCC target("avx2") char*mmap(); #define RD(v) int v=0;{int _c;while(_c=*rp++-48,_c>=0)v=v*10+_c;} void radix_sort_aux(unsigned*a,unsigned*b,int n){ int c[256]; for(int i=0;i<256;++i){ c[i]=0; } for(int i=0;i>8|a[i]<<24; } } void radix_sort(unsigned*a,int n){ radix_sort_aux(a,a+n,n); radix_sort_aux(a+n,a,n); radix_sort_aux(a,a+n,n); radix_sort_aux(a+n,a,n); } a[200000]; main(){ char*rp=mmap(0l,1l<<28,1,2,0,0ll); RD(n); RD(m); RD(y); --n; for(int i=0;ic){ b=c; } } } int j=m*2; if(j>=n){ j=n-1; goto owari; } if(y+a[j]0){ int c=a[j--]+a[k++]; k+=j==k; if(b>c){ b=c; } if(y+a[j]>=b){ goto owari; } } if(y+a[j]=b){ j=j+1; } } owari:; printf("%d",j<0?j:a[j]); }