using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace yukicoderTest { class Program { static void Main(string[] args) { string N = Console.ReadLine(); string X = Console.ReadLine(); string[] kyoristr = X.Split(' '); int[] kyori = new int[int.Parse(N)]; int min = 1000000; for (int i = 0; i < kyori.Length; i++) { kyori[i] = int.Parse(kyoristr[i]); } Array.Sort(kyori); Array.Reverse(kyori); for (int i = 0; i < kyori.Length - 1; i++) { if (kyori[i] == kyori[i + 1]) { continue; } int temp = kyori[i] - kyori[i + 1]; if (min > temp) { min = temp; } } Console.WriteLine(min); } } }