#include<bits/stdc++.h>
#include<queue>
using namespace std;
#define what_is(x) cerr << #x << " is " << x << endl;
#define PI acos(-1)
#define hell 1000000007
#define HELL 998244353
#define io ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define fix(n) cout << fixed << setprecision(n)
#define mset(a,n) memset(a,n,sizeof a)
#define rep(i,a,b) for (__typeof((b)) i=(a);i<(b);i++)
#define repp(i,a,b,p) for(__typeof((b)) i=(a);i<(b);i+=p)
#define ren(i,a,b) for(__typeof((a)) i=(a);i>=(b);i--)
#define renn(i,a,b,p) for(__typeof((a) i=(a);i>=(b);i-=p)
#define ADD(a,b,c) ((a)%c+(b)%c)%c
#define SUB(a,b,c) ((a)%c-(b)%c+c)%c
#define MUL(a,b,c) (((a)%c)*((b)%c))%c
#define lbd lower_bound
#define ubd upper_bound
#define ll long long
#define ld long double
#define pb push_back
#define fi first
#define se second
#define vll vector<ll>
#define pll pair<ll,ll>
#define vpll vector<pll>
#define all(v) (v).begin(), (v).end()
#define sz(x) (ll)x.size()
// #define out(n) cout<<n<<" "
#define outl(n) cout<<n<<endl
#define bug(n) {outl(n);return;}
#define pii pair<int,int>
#define lim 9223372036854775805
#define ninf -9223372036854775802
#define M 10000000009
#define eps 1e-9
#define MAX 10
//#define N 100001
#define db(a) for(auto it:a) {cout<<it<<" ";}cout<<endl;
ll prime[MAX];
ll fact[MAX];
const long long INF64 = 1e18;
ll find(vll &a,ll mx){
ll ans=0;
rep(i,0,sz(a)){
ans+=(ll)ceil((1.0*a[i])/(1.0*mx));
ans--;
}
return ans;
}
void solve(ll ttt){
ll n,k;
cin>>n>>k;
vll a(n);
rep(i,0,n)
cin>>a[i];
ll low=0,high=10000000000;
if(k==0){
ll mx=INT_MIN;
rep(i,0,n){
mx=max(mx,a[i]);
}
cout<<mx<<endl;
return ;
}
while(low<high){
ll mid=low+(high-low)/2;
ll req_cut=find(a,mid);
//cout<<"For mid = "<<mid<<" cuts req = "<<req_cut<<endl;
if(req_cut>k){
low=mid+1;
}
else
high=mid;
}
cout<<(ll)low<<endl;
}
int main(){
io;
// sieve();
// factorial();
#ifndef ONLINE_JUDGE
freopen("input1.txt","r",stdin);
// freopen("output1.txt","w",stdout);
#endif
ll t=1;
//cin>>t;
fix(12);
rep(q,1,t+1){
// cout<<"Case #"<<q<<": ";
solve(q);
//solve2();
}
return 0;
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KI2luY2x1ZGU8cXVldWU+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CiAKI2RlZmluZSB3aGF0X2lzKHgpIGNlcnIgPDwgI3ggPDwgIiBpcyAiIDw8IHggPDwgZW5kbDsgCiNkZWZpbmUgUEkgYWNvcygtMSkKI2RlZmluZSBoZWxsIDEwMDAwMDAwMDcKI2RlZmluZSBIRUxMIDk5ODI0NDM1MwojZGVmaW5lIGlvIGlvc19iYXNlOjpzeW5jX3dpdGhfc3RkaW8oZmFsc2UpO2Npbi50aWUoMCk7Y291dC50aWUoMCkKI2RlZmluZSBmaXgobikgY291dCA8PCBmaXhlZCA8PCBzZXRwcmVjaXNpb24obikKI2RlZmluZSBtc2V0KGEsbikgbWVtc2V0KGEsbixzaXplb2YgYSkKI2RlZmluZSByZXAoaSxhLGIpIGZvciAoX190eXBlb2YoKGIpKSBpPShhKTtpPChiKTtpKyspCiNkZWZpbmUgcmVwcChpLGEsYixwKSBmb3IoX190eXBlb2YoKGIpKSBpPShhKTtpPChiKTtpKz1wKQojZGVmaW5lIHJlbihpLGEsYikgZm9yKF9fdHlwZW9mKChhKSkgaT0oYSk7aT49KGIpO2ktLSkKI2RlZmluZSByZW5uKGksYSxiLHApIGZvcihfX3R5cGVvZigoYSkgaT0oYSk7aT49KGIpO2ktPXApCiNkZWZpbmUgQUREKGEsYixjKSAoKGEpJWMrKGIpJWMpJWMKI2RlZmluZSBTVUIoYSxiLGMpICgoYSklYy0oYiklYytjKSVjCiNkZWZpbmUgTVVMKGEsYixjKSAoKChhKSVjKSooKGIpJWMpKSVjCiNk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