#include <cstdio>
#define maxn 200010
#define ll long long

int n,a[maxn];
ll m;
ll check(int x)
{
	ll re=0;
	for(int i=1; i<=n; i++)re+=a[i]/x+(a[i]%x>0)-1;
	return re;
}

int main()
{
	scanf("%d %lld",&n,&m);
	for(int i=1; i<=n; i++)scanf("%d",&a[i]);
	int l=1,r=1e9,mid,ans;
	while(l<r)
	{
		mid=l+r>>1;
		if(check(mid)<=m)
			r=mid;
		else 
			l=mid+1;
	}
	printf("%d",l);
}
