#include<cstdio>
#include<iostream>
#include<cmath>
using namespace std;
typedef long long LL;
double a[300050];
int n,k;
bool can(double len){
	LL cnt=0;
	for(int i=1;i<=n;i++){
		cnt+=ceil(1.0*a[i]/len)-1;
		//cout<<cnt<<' ';
		if(cnt>k)return 0;
	}
	return 1;
}
int main(){
	cin>>n>>k;
	for(int i=1;i<=n;i++)cin>>a[i];
	double l=0,r=1e9+1;
	while(r-l>1e-3){
		double mid=(l+r)/2;
		if(can(mid))r=mid;
		else l=mid;
	}
	int ans=round((l+r)/2);
	cout<<ans<<endl;
	//cerr<<(l+r)/2<<endl;
	//printf("%.0lf",(l+r)/2);
	//cout<<"-----\n";
	//cout<<can(1);
	return 0;
}