import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) { BufferedReader stdReader =new BufferedReader(new InputStreamReader(System.in)); try { int N = Integer.parseInt(stdReader.readLine()); int K = Integer.parseInt(stdReader.readLine()); int max = 0; int min = 1000; int c = 0; for(int i=0;ic) min = c; if(max < c) max = c; } System.out.println(max-min); } catch (IOException e) { e.printStackTrace(); } } }