#include #include int main() { //std::ifstream inf("Text.txt"); std::cin.rdbuf(inf.rdbuf()); int N = 0; std::cin >> N; int a[1000] = { 0 }; int min = 0; int max = 0; int length = 200000; std::cin >> a[0]; min = max = a[0]; for (int i = 1; i < N; i++) { std::cin >> a[i]; if (a[i] < min) { min = a[i]; } if (a[i] > max) { max = a[i]; } if (a[i] - a[i - 1] < length) { length = a[i] - a[i - 1]; } } std::cout << length << std::endl; std::cout << max - min << std::endl; return 0; }