using System; using System.Collections.Generic; using System.Linq; namespace Yukicoder { class Program { static void Main(string[] args) { int N = int.Parse(Console.ReadLine()); List ary = new List(); ary.AddRange(Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray()); ary.Sort(); int dif = 0; for (int i = 1; i < ary.Count; i++) { int tmp = ary[i] - ary[i - 1]; if (tmp == 0) { continue; } dif = dif == 0 ? tmp : dif > tmp ? tmp : dif; } Console.WriteLine(dif); } } }