#include<bits/stdc++.h>
using namespace std;
const int N=2e5+7;
int n,k,ans,a[N];
bool check(int x)
{
	long long num=0;
	for(int i=1;i<=n;i++)if(a[i]%x==0)num+=a[i]/x-1;else num+=a[i]/x;
	return(num<=k);
}
int main()
{
	scanf("%d%d",&n,&k);
	for(int i=1;i<=n;i++)scanf("%d",&a[i]),ans=max(ans,a[i]);
	int l=1,r=ans-1,mid;
	while(l<=r)
	{
		mid=l+r>>1;
		if(check(mid))ans=mid,r=mid-1;
		else l=mid+1;
	}
	printf("%d",ans);
}