#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
 
#pragma GCC optimize ("O3")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target("avx2,sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
 
using namespace __gnu_pbds; 
using namespace std;
 
#define ld long double
#define pb push_back
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long
#define int long long
#define ull unsigned long long 
#define pii pair<int,int>
#define vii vector<int>
#define f first
#define s second
#define endl "\n"
#define all(container) container.begin(), container.end()
#define onlyunique(v) v.erase(unique(all(v)), v.end());
 
#define TRACE
#ifdef AYUSH
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
    cout << name << " : " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
    const char* comma = strchr(names + 1, ',');cout.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define trace(...)
#endif
 
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
template <class T> ostream& operator << (ostream &os, const vector<T> &v) { for (T i : v) os << i << ' '; return os; }
template <class T> ostream& operator << (ostream &os, const set<T> &v) { for (T i : v) os << i << ' '; return os; }
template <class T> ostream& operator << (ostream &os, const unordered_set<T> &v) { for (T i : v) os << i << ' '; return os; }
template <class T> ostream& operator << (ostream &os, const ordered_set<T> &v) { for (T i : v) os << i << ' '; return os; }
template <class T> ostream& operator << (ostream &os, const multiset<T> &v) { for (T i : v) os << i << ' '; return os; }
template <class T, class S> ostream& operator << (ostream &os, const pair<T, S> &v) { os << '{'<<v.first << ' ' << v.second << '}'; return os; }
template <class T, class S> ostream& operator << (ostream &os, const unordered_map<T, S> &v) { for (auto i : v) os << '(' << i.first << "=>" << i.second << ')' << ' '; return os; }
template <class T, class S> ostream& operator << (ostream &os, const map<T, S> &v) { for (auto i : v) os << '(' << i.first << "=>" << i.second << ')' << ' '; return os; }
//order_of_key (k) : Number of items strictly smaller than k .
//find_by_order(k) : K-th element in a set (counting from zero)
 
int const mod = 1e9+7;
int const inf = 1e18;
 
int power(int x, int y, int mod = 2e18){ int ans = 1;x %= mod;while(y){if(y&1)ans = (x * ans) % mod;x = (x * x) % mod;y >>= 1;}return ans;}
int modinv(int a, int m){return power(a, m-2, m);}
const ld PI = 3.1415926535897932384626433832795;

void solve() {
    int n, k; cin >> n >> k;
    vii a(n);
    for(int i = 0; i < n; ++i) {
        cin >> a[i];
        int x = 1;

    }

    ld l = 1, r = 1e9;
    ld delta = 9.9999999, ans = 1e9;
    while(l <= r) {
        int req  = 0;
        ld mid = (l + r)/2;
        for(auto y: a) {
            int f = (ld)y / mid;
            string x = to_string(f);
            int fx = 0;
            trace(x);
            int i = 0; 
            while(i < x.size()) {
                if(x[i] == '.')
                    break;
                fx *= 10;
                fx += x[i] - '0';
                ++i;
            }
            if(f - fx >= 0.0001) {
                f = ceil(f);
            }
            req += (int)f;
        }
        trace(l, r, mid, req);
        if(req <= k) {
            r = mid - 0.000001;
            ans = min(ans, mid);
            trace(ans);
        }
        else {
            l = mid + 0.000001;
        }
    }
    string x = to_string(ans);
    int ansx = 0;
    trace(x);
    int i = 0; 
    while(i < x.size()) {
        if(x[i] == '.')
            break;
        ansx *= 10;
        ansx += x[i] - '0';
        ++i;
    }
    trace(ans - ansx);
    if(ans - ansx >= 0.0001) {
        ans = ceil(ans);
    }
    cout << (int)ans << endl;
    // trace(ans);
    // ld x = (int)ans;

    // if(ans - x >= 0.000001) {
    //     ans = ceil(ans);
    // }
    // trace(ans - x);
    // cout << ans << endl;

    // cout << (int)ans << endl;


    /*
    vector<int> a(n);
    map<long double, int> mp;
    int c = 0;
    for (int i = 0; i < n; ++i) {
        int x; cin >> x;
        mp[x]++;
        while(x) {
            x >>= 1;
            ++c;
        }
    }
    if(k >= c) {
        cout << 1 << endl;return;
    }
    trace(mp);
    while(k--) {
        auto it = mp.rbegin();
        long double big = (*it).f;
        mp[big]--;
        mp[big/2]+=2;
        if(mp[big] == 0) {
            mp.erase(big);
        }
        trace(mp);
    }
    trace(mp);
    auto it = mp.rbegin();
    long double big = (*it).f;
    int ans = ceil(big);
    cout << ans << endl;
    */
}
signed main() {
    IOS
    int t = 1, T = 1;
    // cin>>t;
    while (t--) {
        // cout<<"Case #"<<T<<": ";
        solve();
        // ++T;
    }
    return 0;
}

Measured memory_bytes: 4676