#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
	int N, K;
	cin >> N >> K;
	vector<ll> A(N);
	for (auto& x : A) cin >> x;
	ll L = 0, R = 1LL<<30;
	while (R-L >= 2) {
		auto m = (L+R)/2;
		ll c = 0;
		for (auto x : A) {
			c += (x-1) / m;
		}
		if (c <= K) {
			R = m;
		} else {
			L = m;
		}
	}
	cout << R << endl;
}
