#include <bits/stdc++.h>
#define maxn 202333
using namespace std;
int a[maxn], Ma;
int main() {
	long long n, k;
	cin >> n >> k;
	for(int i = 1; i <= n; ++i) cin >> a[i], Ma = max(Ma, a[i]);
	int L = 0, R = Ma, m;
	while(R - L > 1) {
		m = (L + R) >> 1;
		if(m == 0) break;
		long long A = 0;
		for(int i = 1; i <= n; ++i) A += (a[i] - 1) / m;
		if(A > k) L = m;
		else R = m;
	}
	cout << R;
	return 0;
}