using System.Collections.Generic; using System; using System.Drawing; namespace yukicoder { class Program { static void Main(string[] args) { int N = int.Parse(Console.ReadLine()); var str = Console.ReadLine().Split(" "); int n = 0, ans = 0 , temp = 0; List list = new List(N); for(int i = 0; i < N; i++) { list.Add(int.Parse(str[i])); if (list[n] == 0) { list.RemoveAt(n); n--; } n++; } list.Sort(); if (list.Count < 2) //配列が1以下 { Console.WriteLine("0"); } else if (!(list.Count < 2)) { temp = list[list.Count - 1]; } for (int j = 0; j < list.Count ; j++) { ans = list[j + 1] - list[j]; if(ans < temp && !(list.Count <= 2) || j == list.Count - 2 && !(list.Count <= 2)) { if(j == list.Count - 2) { Console.WriteLine(temp); break; } else if (list[0] == list[list.Count - 1]) { Console.WriteLine(list[0]); break; } else if (list[j + 1] == list[j]) { temp = list[j + 1] / list[j]; } else { temp = ans; } } else if (list.Count <= 2 && !(list[0] == list[1])) { Console.WriteLine(list[j + 1] - list[j]); break; } else if(list[0] == list[1]) { Console.WriteLine(temp); break; } } } } }