import java.util.Scanner; public class Main{ public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int g = sc.nextInt(); int[] a = new int[n]; for(int i=0;i0+i;j--) { if(a[j]>a[j-1]) { int temp = a[j]; a[j] = a[j-1]; a[j-1] = temp; } } } System.out.println(a[0]-a[a.length-1]); } }