#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

// Function to check if we can place m cameras with max distance S
bool canPlaceCameras(const vector<long long>& houses, int n, int m, long long S) {
    int camerasUsed = 1; // Place the first camera at houses[0]
    long long lastCameraPos = houses[0];

    for (int i = 1; i < n; i++) {
        if (houses[i] - lastCameraPos > S) {
            camerasUsed++;
            lastCameraPos = houses[i]; // Place a new camera
            if (camerasUsed > m) return false;
        }
    }
    return true;
}

int main() {
    // Read input
    int n, m;
    cin >> n >> m;
    vector<long long> houses(n);
    for (int i = 0; i < n; i++) {
        cin >> houses[i];
    }

    // Binary search for minimum S
    long long left = 0, right = houses[n - 1] - houses[0], answer = right;
    while (left <= right) {
        long long mid = (left + right) / 2;
        cout << mid << ' ';
        if (canPlaceCameras(houses, n, m, mid)) {
            answer = mid;  // Try smaller S
            right = mid - 1;
        } else {
            left = mid + 1;
        }
    }

    cout << answer << endl;
    return 0;
}
