import java.util.Scanner; public class Test { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(), t = sc.nextInt(), max = 0, min = 1000; for(int i = 0; i < n; i++){ t = sc.nextInt(); max = Math.max(max, t); min = Math.min(min, t); } System.out.println(max-min); } }