#include #include using namespace std; int main() { int n; int64_t k; cin >> n >> k; vector v(n); auto can = [&](int64_t thresh) -> bool { int64_t need = 0; for(auto out: v) need += (out + thresh - 1) / thresh; return need <= k; }; for(auto& x: v) cin >> x; int64_t lhs = 1; int64_t rhs = 1e18; while(lhs < rhs) { int64_t mid = (lhs+rhs)/2; if(can(mid)) rhs = mid; else lhs = mid+1; } cout << lhs << "\n"; }