#include <bits/stdc++.h>

using namespace std;

int a[202020];
int n,k;

int check(int x) {
	int cnt = 0;
	for (int i = 1; i <= n; i++) {
		cnt += (a[i] / x) - (a[i] % x == 0);
	}
	return cnt <= k;
}

int main() {
	scanf("%d%d",&n,&k);
	for (int i = 1; i <= n; i++) scanf("%d", a + i);

	int l = 1, r = 1000000000;

	while (l < r) {
		int ans = (l+r)/2;
		if (check(ans)) r = ans;
		else l = ans + 1;
	}

	printf("%d\n",l);
	return 0;
}
