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