using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace template { class Program { static void Main(string[] args) { int n = int.Parse(Console.ReadLine()); int k = int.Parse(Console.ReadLine()); int[] x = new int[n]; for (int i = 0; i < n; i++) { x[i] = int.Parse(Console.ReadLine()); } Console.WriteLine(x.Max() - x.Min()); } } }