import java.util.ArrayList; import java.util.Collections; import java.util.Scanner; public class Main { public static void main(String[] args) { try (Scanner scan = new Scanner(System.in)) { int n = Integer.parseInt(scan.next()); int m = Integer.parseInt(scan.next()); ArrayList list = new ArrayList<>(); int leftC = 0; int rightC = 0; for(int i=0; i 0) rightC ++; if(v < 0) leftC ++; list.add(v); } if( list.indexOf(new Integer(0)) < 0) { list.add(new Integer(0)); } else { n--; } Collections.sort(list); int zeroIndex = list.indexOf(new Integer(0)); int ans = Integer.MAX_VALUE; if(zeroIndex == 0) { ans = list.get(n); } else if(zeroIndex == m) { ans = Math.abs(list.get(zeroIndex-n)); } else { for(int i=zeroIndex; i