using System; using System.Collections.Generic; using System.Linq; class Program { static void Main(string[] args) { var n = int.Parse(Console.ReadLine()); var list = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray(); var dMap = new SortedDictionary(); var abs = 0; for (int i=0; i < n; i++) { for (int j=i+1; j < n; j++) { abs = Math.Abs(list[j] - list[i]); if (abs == 0) continue; if (dMap.ContainsKey(abs)) dMap[abs]++; else dMap.Add(abs, 1); } } Console.WriteLine(dMap.Count() != 0 ? dMap.ElementAt(0).Key : 0); } }