package yukicoder; import java.util.Arrays; import java.util.Comparator; import java.util.Scanner; public class N370 { public static void main(String[] args) { Scanner sc=new Scanner (System.in); int N=sc.nextInt(),M=sc.nextInt(); Integer[] d=new Integer[M]; Integer[] pbuf=new Integer[M]; Integer[] nbuf=new Integer[M]; for(int i=0;i0){pbuf[pos++]=d[i];} if(d[i]<0){nbuf[neg++]=d[i];} } Arrays.sort(d); Arrays.sort(pbuf,Comparator.naturalOrder()); Arrays.sort(nbuf,Comparator.reverseOrder()); Integer[] Ph=new Integer[N]; for(int i=0;ians){min=ans;} } System.out.println(min); } }