#include #include #include using namespace std; int main() { int n,x; cin >> n; vector a(n),b(n*(n-1)/2); for (int i = 0; i < n; i++) { cin >> a[i]; } x = 0; for (int i = 0; i < n-1; i++) { for (int j = i + 1; j < n; j++) { b[x] = a[j] - a[i]; x++; } } sort(b.begin(), b.end()); cout << b[0] << endl; cout << b[n*(n - 1) / 2-1] << endl; }