import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.Arrays; import java.util.InputMismatchException; import java.io.OutputStream; import java.util.StringTokenizer; import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.HashMap; import java.util.Map; import java.util.ArrayList; import java.util.List; /** * Built using CHelper plug-in * Actual solution is at the top */ public class Main { public static void main(String[] args) { InputStream inputStream = System.in; OutputStream outputStream = System.out; InputReader in = new InputReader(inputStream); PrintWriter out = new PrintWriter(outputStream); Task solver = new Task(); solver.solve(1, in, out); out.close(); } static class Task { public void solve(int testNumber, InputReader in, PrintWriter out) { int N = in.nextInt(); int M = in.nextInt(); int D[] = new int[M]; int plus=0; int minus=0; int PO[] = new int[M]; int NE[] = new int[M]; Arrays.fill(PO,1000000); Arrays.fill(NE,1000000); for(int i=0; i0){ PO[plus] = D[i]; plus++; } if(D[i]<0){ NE[minus] = -D[i]; minus++; } if(D[i]==0) N--; } Arrays.sort(NE); int res=Math.min(NE[N-1],PO[N-1]); for(int k=0; k<=N-2; k++){ if(PO[k]*2+NE[N-k-2]