using System; using System.Collections.Generic; using System.IO; using System.Linq; class Solution { static void Main(String[] args) { int n = Convert.ToInt32(Console.ReadLine()); string[] a_temp = Console.ReadLine().Split(' '); int[] a = Array.ConvertAll(a_temp, Int32.Parse); int smallest = Int32.MaxValue; Array.Sort(a); for (int i = 1; i < n; i++) { if (Math.Abs((a[i - 1] - a[i])) < smallest) smallest = Math.Abs((a[i - 1] - a[i])); } Console.WriteLine(smallest); } }