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); double min = Math.Pow(10, 5) + 1; for (int i = 1; i < n; i++) { if (x[i] == x[i - 1]) { continue; } if (x[i] - x[i - 1] < min) { min = x[i] - x[i - 1]; } } if (min == Math.Pow(10, 5) + 1) { min = 0; } Console.WriteLine(Math.Abs((int)min)); Console.Read(); } }