#include <iostream>

using namespace std;
int a[200010];
int main(){
    int i,n,k; cin >> n >> k;
    for(i=0;i<n;i++) cin >> a[i];
    int l = 0,r = 1000000000;
    while(r - l>1){
        int mid =(l + r)/2,cnt = 0;
        for(i=0;i<n;i++){
            if(a[i]<=mid) continue;
            if(a[i]%mid==0) cnt += a[i]/mid - 1;
            else cnt += a[i]/mid;
        }
        if(cnt<=k) r = mid;
        else l = mid;
    }
    cout << r << endl;
}