package yukicoder; import java.util.Arrays; import java.util.Scanner; public class Yuki21 { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int count = scan.nextInt(); int group = scan.nextInt(); int[] numArr = new int[count]; for (int i = 0; i < count; i++ ) { numArr[i] = scan.nextInt(); } scan.close(); Arrays.sort(numArr); System.out.println(numArr[count-1] - numArr[0]); } }