// بسم الله الرحمن الرحيم
// وَأَطِيعُوا اللَّهَ وَأَطِيعُوا الرَّسُولَ ۚ فَإِن تَوَلَّيْتُمْ فَإِنَّمَا عَلَىٰ رَسُولِنَا الْبَلَاغُ الْمُبِينُ
// author: khalid007
// Halal Template
#pragma GCC optimize("03")
#pragma GCC target ("sse4")
//(UNCOMMENT WHEN HAVING LOTS OF RECURSIONS)\
#pragma comment(linker, "/stack:200000000")
//(UNCOMMENT WHEN TRYING TO BRUTEFORCE WITH A LOT OF LOOPS)\
#pragma GCC optimize("unroll-loops")
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
// #include <boost/math/common_factor.hpp>
using namespace std;
using namespace std::chrono;
using namespace __gnu_pbds;

// https://codeforces.com/blog/entry/62393
struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
    size_t operator()(pair<int64_t,int64_t> Y) const{
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(Y.first * 31 + Y.second + FIXED_RANDOM);
    }
};

template<class __Type> using ordered_set = tree<__Type, null_type,less<__Type>, rb_tree_tag,tree_order_statistics_node_update> ;

template<class __Type__> ostream& operator<<(ostream &stream, vector<__Type__> V) {
    stream << "[ ";
    for(auto v : V) stream << v << " ";
    return stream << "]";
}
template<class __Type__> ostream& operator<<(ostream &stream, set<__Type__> S){
    stream << "{ ";
    for(auto s:S) stream << s << " ";
    return stream << "}";
}
template<class __Type__> ostream& operator<<(ostream &stream, unordered_set<__Type__> S){
    stream << "{ ";
    for(auto s:S) stream << s << " ";
    return stream << "}";
}
template<class __Type__> ostream& operator << (ostream& stream, multiset<__Type__> S){stream << "{ "; for(auto s:S) stream << s << " "; return stream << "}";}

template<class __Type__> ostream& operator<<(ostream &os, ordered_set<__Type__> S){
    os << "{ ";
    for(auto s:S) os<<s<<" ";
    return os<<"}";
}

template<class __Type_L__, class __Type_R__> ostream& operator<<(ostream &os, pair<__Type_L__, __Type_R__> P) {
    return os << "(" << P.first << "," << P.second << ")";
}
template<class __Type_L__, class __Type_R__> ostream& operator<<(ostream &os, map<__Type_L__, __Type_R__> M) {
    os << "{ ";
    for(auto m:M) os<<"("<<m.first<<":"<<m.second<<") ";
    return os<<"}";
}
template<class __Type_L__, class __Type_R__, class chash = std::hash<__Type_R__>> ostream& operator<<(ostream &stream, unordered_map<__Type_L__, __Type_R__, chash> M) {
    stream << "{ ";
    for(auto m:M) stream << "(" << m.first << " : " << m.second << ") ";
    return stream << "}";
}
template<class L, class R, class chash = std::hash<R> > ostream& operator<<(ostream &os, gp_hash_table<L,R,chash> M) {
    os << "{ ";
    for(auto m:M) os<<"("<<m.first<<":"<<m.second<<") ";
    return os<<"}";
}

// using namespace __gnu_pbds;
// Uncommet this when required
#define LONG_CONDITION_FOR_CP
#ifdef LONG_CONDITION_FOR_CP
    #define int                                     int_least64_t
#endif
// Uncomment when you multiple test_case\
#define MULTIPLE_TESTCASE
#ifdef MULTIPLE_TESTCASE
    #define ForAllTestCase                          int TEST_CASE; cin >> TEST_CASE; while(TEST_CASE--)
#else
    #define ForAllTestCase                          1;
#endif

#define __MOD_CONDITION_1e9_7

// Uncomment this
#define __TRACE_CONDITION__
#ifdef __TRACE_CONDITION__
    #define names(...)                              cout << #__VA_ARGS__ << endl;
    #define dbg(...)                                __f(#__VA_ARGS__, __VA_ARGS__)
    template <typename __Type1__>                   void __f(const char* name, __Type1__&& arg1)
                                                    {cerr << name << " = " << arg1 << endl;}
    template <typename __Type1__, 
    typename... __Types__>                          void __f(const char* names, __Type1__&& arg1, __Types__&&... args)
                                                    {const char* comma = strchr(names + 1, ',');
                                                    cerr.write(names, comma - names) << " = " << arg1<<" , ";
                                                    __f(comma+1, args...);}
#else
    #define dbg(t)                                  cout << #t << " = "<< t << endl
#endif
#define lp(i, s, e)                                 for(int i = s; i < e; i++)
#define rlp(i, s, e)                                for(int i = s; i >= e; i--)
#define rpt(n)                                      for(int _Iter_ = 0; _Iter_ < n; _Iter_++)
#define fstl(i, v)                                  for(auto& i: v)
#define all(x)                                      (x).begin(), (x).end()
#define maxMin(x, y)                                max(x,y), min(x,y)
#define minMax(x, y)                                min(x,y), max(x,y)
#define pb                                          push_back
#define eb                                          emplace_back
#define mk 		                                    make_pair
#define f                                           first
#define s                                           second
#define vi                                          vector<int>
#define pii                                         pair<int, int>
#define PPX(x)                                      fixed << setprecision(x) // PPX stands for precision print for float and double
#define hi                                          cerr << "Peace be Upon You" << endl // Use for debugging purpose
#define stlOut(vector, __Type, char_sep)            copy(vector.begin(), vector.end(), ostream_iterator<__Type>(cout, char_sep)); cout << "\n"
#define sout(beginIter, endIter, __Type, char_sep)  copy(beginIter, endIter, ostream_iterator<__Type>(cout, char_sep)); cout << "\n"

const int MOD = 1e9 + 7, __MOD__ = 998244353;

int mpow(int a, int b, int m = MOD){int c=1;while(b){if(b&1) c=(c*a)%m;b>>=1;a=(a*a)%m;}return c;}
int pow(int a, int b){int c = 1;while(b){if(b&1)c=(c*a);b>>=1;a=(a*a);}return c;}
int inv(int a) {return mpow(a, MOD - 2, MOD);}

template<class __Type__> class TwoD{
private:
    __Type__** __Container__;
    int column, row;
public:
    TwoD(int row, int column, __Type__ __init_value__) : row(row), column(column) {
        __Container__ = new __Type__*[row];
        lp(i,0,row){
            __Container__[i] = new __Type__[column];
            fill_n(__Container__[i], column, __init_value__);
        }
    }

    ~TwoD(){lp(i,0,row) delete[] __Container__[i]; delete[] __Container__;}

    __Type__* operator[](int x) {return __Container__[x];}

    void out(){lp(i,0,row){ sout(__Container__[i], __Container__[i] + column, __Type__, " ");}}
};

class Integer{
    int64_t x; static int64_t _MOD_;

public:
    Integer() : x(0) {}
    Integer(int32_t x) : x(x) {}
    Integer(int64_t x) : x(x) {}
// #ifndef LONG_CONDITION_FOR_CP
//     Integer(int64_t x) : x(x) {}
// #endif
    Integer operator+(Integer b) {Integer ans = (x + b.x)%_MOD_;return ans;}
    Integer operator+=(Integer b) {x = (x + b.x)%_MOD_;}
    Integer operator-(Integer b) {Integer ans = (x - b.x + _MOD_)%_MOD_; return ans;}
    Integer operator-=(Integer b) {x = (x - b.x + _MOD_)%_MOD_;}
    Integer operator*(Integer b) {Integer ans = (x * b.x) % _MOD_;}
    Integer operator*=(Integer b) {x = (x * b.x)%_MOD_;}
    operator int(){return x;}
    friend ostream& operator<<(ostream& stream, Integer& I);
    friend istream& operator>>(istream& stream, Integer& I);
};
#ifdef __MOD_CONDITION_1e9_7
    int64_t Integer::_MOD_ = MOD;
#else
    int64_t Integer::_MOD_ = __MOD__;
#endif
ostream& operator<<(ostream& stream, Integer& I){stream << I.x;return stream;}
istream& operator>>(istream& stream, Integer& I){stream >> I.x; return stream;}

// ---------------------------------------------------------- <Your Main code> --------------------------------------------------------------//
int n, k, low, high;
int isSolvable(vector<int>& a, int mid)
{
    int indx = upper_bound(a.begin(), a.end(), mid) - a.begin(), cnt = 0;

    lp(i, indx, n) cnt += max(ceil((a[i]*1.00)/mid) - 1, 0.00);

    if(cnt <= k) return 1;
    else return 0;
}

void solve()
{
    low = 1, high = 0;
    cin >> n >> k;

    vector<int> a(n);
    lp(i,0,n) cin >> a[i], high = max(a[i], high);

    sort(a.begin(), a.end());


    while(high - low > 1) {
        int mid = (high + low)/2;

        if(isSolvable(a, mid)) high = mid;
        else low = mid;
    }

    if(isSolvable(a, low)) cout << low;
    else cout << high;
}
// --------------------------------------------------------- </Your Main code> --------------------------------------------------------------//


int32_t main() {
    ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
    // File input
    #ifndef ONLINE_JUDGE    
        freopen("fin.txt", "r", stdin);
        freopen("fout.txt", "w", stdout);
    #endif

    ForAllTestCase {
        //Execution time
        auto start = high_resolution_clock::now(); 
        solve();
        auto stop = high_resolution_clock::now(); 
        auto duration = duration_cast<microseconds>(stop - start); 

        #ifndef ONLINE_JUDGE
            cerr << PPX(10) << "\n\n\n_______________________________________________________________________________________________________"
                << "\n\t\t\t\tExecution time of solve(): "
         << duration.count() << " ms" << "\n" << "_______________________________________________________________________________________________________\n";
        #endif
    }
}

Measured memory_bytes: 4764