#include <bits/stdc++.h>
using namespace std;

using ll = int64_t;
const int MAX = 2e5;

int32_t main()
{
    ios::sync_with_stdio(false), cin.tie(nullptr);
    int n, k; cin >> n >> k;
    vector<int> v(n);
    for (int &it : v) cin >> it;

    int L = 0, R = 1e9;
    while (R-L > 1) {
        ll cut = (L+R)/2, cnt = 0;
        for (int i : v) cnt += (i-1)/cut;
        if (cnt > k) L = cut;
        else R = cut;
    }
    cout << R;

    return 0;
}