#include <bits/stdc++.h>
#define ll long long int
using namespace std;

ll n,k;
vector<ll> a;
bool C(ll x){
    int cnt=0;
    for(int i=0;i<n;++i){
        if(a[i]>x) cnt+=a[i]/x;
    }
    return cnt<=k;
}
int main(){
    cin>>n>>k;
    ll h=0;
    a=vector<ll>(n);
    for(int i=0;i<n;++i){
        cin>>a[i];
        h=max(h,a[i]);
    }
    ll l=0;
    while(h-l>1){
        ll m=(h+l)/2;
        if(C(m)) h=m;
        else l=m;
    }
    cout<<h<<endl;

}