using System; using System.Collections.Generic; using System.Linq; namespace Test { class Program { static void Main(string[] args) { int n = int.Parse(Console.ReadLine()); int[] x = Console.ReadLine().Split().Select(int.Parse).ToArray(); Array.Sort(x); int ret = int.MaxValue; for (int i = 1; i < n; i++) { if (x[i] - x[i - 1] != 0) { ret = Math.Min(ret,x[i] - x[i - 1]); } } Console.WriteLine(ret == int.MaxValue ? 0 : ret); } } }