import std.string;
import std.conv;
import std.array;
import std.stdio;
import std.algorithm;
import std.range;
import std.math;
import std.container;

struct Log {
	double length, beforeLength;
	long cut;
}

void main() {
	Log convert(long s) {
		Log log;
		log.length = log.beforeLength = cast(double)s;
		return log;
	}

	long n, k;
	readf("%s %s\n", &n, &k);

	auto lengthes = readln.chomp.split(' ').map!(to!long).array;
	auto sumLength = lengthes.sum;
	auto logs = lengthes.map!convert.array;

	auto rest = k;
	foreach (ref log;logs) {
		log.cut = cast(long)(log.beforeLength / sumLength * k);
		if (log.cut > rest) {
			log.cut = rest;
		}
		log.length = log.beforeLength / (log.cut + 1);

		rest -= log.cut;
		if (rest <= 0) break;
	}

	auto heap = heapify!"a.length < b.length"(logs);
	while (rest > 0) {
		auto log = heap.front;
		heap.removeFront;

		log.cut++;
		log.length = log.beforeLength / (log.cut + 1);

		heap.insert(log);
		--rest;
	}

	writeln(cast(long)ceil(heap.front.length));
}
