using System; using System.Linq; class Program { static void Main() { int n = int.Parse(Console.ReadLine()); int min = 1000001; if (n < 2) { min = 0; } else { var q = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToList(); q.Sort(); for (int i = 0; i < n - 1; i++) { if (q[i] == q[i + 1]) continue; int d = Math.Abs(q[i] - q[i + 1]); if (d < min) min = d; } if (min == 1000001) min = 0; } Console.WriteLine(min); } }