/* No.716 距離 https://yukicoder.me/problems/no/716 */ #include using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); int n; cin >> n; vector vi(n); for (int i = 0; i < n; i++) { cin >> vi[i]; } sort(vi.begin(), vi.end()); int max_len = vi.back() - vi.front(); int min_len = 1000000000; for (int i = 0; i < n - 1; i++) { min_len = min(min_len, abs(vi[i] - vi[i + 1])); } cout << min_len << endl; cout << max_len << endl; }