using System; public class Program { public static void Main(string[] args) { Console.ReadLine(); // n string[] s = Console.ReadLine().Split(' '); int[] x = new int[s.Length]; for (int i = 0; i < x.Length; i++) { x[i] = int.Parse(s[i]); } Array.Sort(x); int min = 0; for (int i = 1; i < x.Length; i++) { int dist = Math.Abs(x[i] - x[i-1]); if (dist < min && dist != 0 || min == 0) { min = dist; } } Console.WriteLine(min); } }