#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define loop(i,a,b) for(int i=a;i pii; typedef vector vi; typedef vector vvi; typedef vector vp; typedef vector vvp; typedef vector vs; typedef vector vd; typedef tuple tp; typedef vector vt; typedef vector vvd; typedef pair pip; typedef vectorvip; const double PI=acos(-1); const double EPS=1e-7; const int inf=1e8; const ll INF=1e16; int dx[]={0,1,0,-1}; int dy[]={1,0,-1,0}; int main(){ int n,m; cin>>n>>m; vi in(m); rep(i,m)cin>>in[i]; sort(all(in)); int out=inf; rep(i,m-n+1){ int l=in[i],r=in[i+n-1]; out=min(out,min(abs(r)+r-l,abs(l)+r-l)); } cout<