using System; using System.Collections.Generic; using System.Linq; public class Program { static void Main() { int Width = int.Parse(Console.ReadLine()); int Group = int.Parse(Console.ReadLine()); var ValueList = GetInt(Width).ToList().OrderByDescending(a => a); int Result = ValueList.First() - ValueList.Last(); Console.WriteLine(Result); } static IEnumerable GetChar(){ int Moji = 0; int Count = 1; char tmp = (char)0; while((Moji = Console.Read()) != -1){ if(Moji <65 || Moji >90){ break; } tmp = (char)(( Moji - 65 + 26 - Count)%26 + 65); yield return tmp; Count = (Count + 1)%26; } } static IEnumerable GetInt(int Loop){ for(var i = 0; i < Loop ; i++){ yield return int.Parse(Console.ReadLine()); } } static void WriteLine (T dsads){ } }