using System; using System.Text; using System.Linq; using System.Collections; using System.Collections.Generic; using static System.Console; using static System.Math; namespace YukiCoder { public class Program { public static void Main(string[] args) { new Program().Solve(); } public void Solve() { int n = int.Parse(ReadLine()); int[] a = Console.ReadLine().Split().Select(x => int.Parse(x)).ToArray(); double min = Math.Pow(2, 1024); double max = -1; for (int i = 0; i < a.Length - 1; i++) { for (int j = i + 1; j <= a.Length - 1; j++) { if (a[j] - a[i] < min) { min = a[j] - a[i]; } if (a[j] - a[i] > max) { max = a[j] - a[i]; } } } WriteLine(min); WriteLine(max); } } }