import java.util.Arrays; import java.util.Scanner; public class No21 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int k = sc.nextInt(); int[] nums = new int[n]; for (int i = 0; i < n; i++) { nums[i] = sc.nextInt(); } Arrays.sort(nums); int minAvg = nums[0]; int maxAvg = nums[n - 1]; System.out.println(maxAvg - minAvg); sc.close(); } }