void main() {
  problem();
}

void problem() {
  const N = scan!int;
  const K = scan!long;
  auto A = scan!long(N).sort().array;

  void solve() {
    binarySearch(1L, A[$-1], (long m) {
      auto cutTimes = A.map!(a => (a + m - 1) / m - 1).sum();
      [m, K, cutTimes].deb;
      return K >= cutTimes;
    }).writeln;
  }

  solve();
}

// ----------------------------------------------

import std.stdio, std.conv, std.array, std.string, std.algorithm, std.container, std.range, core.stdc.stdlib, std.math, std.typecons, std.numeric;
T[][] combinations(T)(T[] s, in int m) {   if (!m) return [[]];   if (s.empty) return [];   return s[1 .. $].combinations(m - 1).map!(x => s[0] ~ x).array ~ s[1 .. $].combinations(m); }
string scan(){ static string[] ss; while(!ss.length) ss = readln.chomp.split; string res = ss[0]; ss.popFront; return res; }
T scan(T)(){ return scan.to!T; }
T[] scan(T)(int n){ return n.iota.map!(i => scan!T()).array; }
void deb(T ...)(T t){ debug writeln(t); }
alias Point = Tuple!(long, "x", long, "y");

T binarySearch(T)(T min, T max, bool delegate(T t) fun) {
  [min, max].deb;
  if (fun(min)) return min;

  if (fun(max)) {
    auto middle = (min + max) / 2;
    if (min == middle) return max;

    if (fun(middle)) {
      return binarySearch(min, middle, fun);
    } else {
      return binarySearch(middle, max, fun);
    }
  }

  throw(new Error("test"));
}

// -----------------------------------------------
