#define LOCAL
#ifdef LOCAL
#define _GLIBCXX_DEBUG
#endif
#include <bits/stdc++.h>
using namespace std;

#define rep(i,s,n) for (int i = (ll)s; i < (ll)n; i++)
#define rrep(i,n,e) for (int i = (ll)n; i > (ll)e; i--)
#define ll long long
#define ld long double
#define pb push_back
#define eb emplace_back
#define All(x) x.begin(), x.end()
#define Range(x, i, j) x.begin() + i, x.begin() + j
#define lbidx(x, y) lower_bound(x.begin(), x.end(), y) - x.begin()
#define ubidx(x, y) upper_bound(x.begin(), x.end(), y) - x.begin()
#define llbidx(x, y, z) lower_bound(x.begin(), x.end(), z) - lower_bound(x.begin(), x.end(), y) // dist between two elements
// #define M_PI 3.14159265358979323846 // CF
#define deg2rad(deg) ((((double)deg)/((double)360)*2*M_PI))
#define rad2deg(rad) ((((double)rad)/(double)2/M_PI)*(double)360)
#define Find(set, element) set.find(element) != set.end()
#define Decimal(x) cout << fixed << setprecision(10) << x << endl; // 小数点を10桁まで表示
#define endl "\n"
#define Case(x) printf("Case #%d: ", x); // gcj

typedef pair<int, int> PI;
typedef pair<ll, ll> PLL;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<vector<vector<int>>> vvvi;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef vector<vector<vector<ll>>> vvvl;
typedef vector<PI> vpi;
typedef vector<vector<PI>> vvpi;
typedef vector<PLL> vpl;
typedef vector<vector<PLL>> vvpl;
typedef vector<char> vch;
typedef vector<vector<char>> vvch;

constexpr ll LINF = 1001002003004005006ll;
constexpr int INF = 1001001001;
constexpr int n_max = 2e5+10;

template<class T>
inline bool chmax(T &a, T b) { if(a<b) { a=b; return true; } return false; };
template<class T>
inline bool chmin(T &a, T b) { if(a>b) { a=b; return true; } return false; };

template<class T, class U>
T POW(T x, U n) {T ret=1; while (n>0) {if (n&1) {ret*=x;} x*=x; n>>=1;} return ret;};

// debug
template <typename A, typename B>
string to_string(pair<A, B> p);
string to_string(const string &s) {return '"' + s + '"';};
string to_string(const char c) {return to_string((string) &c);};
string to_string(bool b) {return (b ? "true" : "false");};
template <size_t N>
string to_string(bitset<N> v){
  string res = "";
  for(size_t i = 0; i < N; i++) res += static_cast<char>('0' + v[i]);
  return res;
};
template <typename A>
string to_string(A v) {
  bool first = true;
  string res = "{";
  for(const auto &x : v) {
    if(!first) res += ", ";
    first = false; res += to_string(x);
  }
  res += "}";
  return res;
};
template <typename A, typename B>
string to_string(pair<A, B> p){return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";}

void debug_out() {cerr << endl;};
template<typename Head, typename... Tail>
void debug_out(Head H, Tail... T) { cerr << " " << to_string(H); debug_out(T...); };

#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 71
#endif

void print() { cout << endl; }
template <class Head, class... Tail>
void print(Head&& head, Tail&&... tail) {
  cout << head;
  if (sizeof...(tail) != 0) cout << " ";
  print(forward<Tail>(tail)...);
};

template <class T>
void print(vector<T> &vec) {
  for (auto& a : vec) {
    cout << a;
    if (&a != &vec.back()) cout << " ";
  }
  cout << endl;
};

template <class T>
void print(vector<vector<T>> &df) {
  for (auto& vec : df) {
    print(vec);
  }
};

class Fraction {
public:
  long long numerator, denominator;
  long long sign;
  Fraction(long long n, long long d, long long s = 0, bool fixed = false) {
    assert(d != 0);
    if (!fixed) {
      if (d == 0) {
        numerator = 0; denominator = 1; sign = 0;
      } else {
        if ((n > 0 && d > 0) || (n < 0 && d < 0)) sign = 1;
        else sign = -1;

        n = abs(n); d = abs(d);
        long long g = __gcd(n, d);
        numerator = n/g; denominator = d/g;
      }
    } else {
      numerator = n; denominator = d; sign = s;
    }
  }

  const Fraction operator+(const Fraction f) const {
    return Fraction(*this) += f;
  }
  const Fraction operator-(const Fraction f) const {
    return Fraction(*this) -= f;
  }
  const Fraction operator*(const Fraction f) const {
    return Fraction(*this) *= f;
  }
  const Fraction operator/(const Fraction f) const {
    return Fraction(*this) /= f;
  }
  const Fraction &operator+=(const Fraction f) {
    long long g = __gcd(denominator, f.denominator);
    long long tmp1 = denominator/g, tmp2 = f.denominator/g;
    long long n = sign*numerator*tmp2+f.sign*f.numerator*tmp1;
    long long d = tmp1*tmp2*g;
    long long s;
    if (n == 0) {
      numerator = 0; d = 1; sign = 0; return *this;
    }

    if ((n > 0 && d > 0) || (n < 0 && d < 0)) sign = 1ll;
    else sign = -1ll;

    n = abs(n); d = abs(d);
    long long g_ = __gcd(n, d);
    numerator = n/g_; denominator = d/g_;
    return *this;
  }

  const Fraction &operator-=(const Fraction f) {
    long long g = __gcd(denominator, f.denominator);
    long long tmp1 = denominator/g, tmp2 = f.denominator/g;
    long long n = sign*numerator*tmp2-f.sign*f.numerator*tmp1;
    long long d = tmp1*tmp2*g;
    long long s;
    if (n == 0) {
      numerator = 0; d = 1; sign = 0; return *this;
    }

    if ((n > 0 && d > 0) || (n < 0 && d < 0)) sign = 1ll;
    else sign = -1ll;

    n = abs(n); d = abs(d);
    long long g_ = __gcd(n, d);
    numerator = n/g_; denominator = d/g_;
    return *this;
  }

  const Fraction &operator*=(const Fraction f) {
    if ((sign&f.sign)==0) {
      numerator = 0; denominator = 1; sign = 0; return *this;
    }
    long long g1 = __gcd(numerator, f.denominator);
    long long g2 = __gcd(denominator, f.numerator);
    numerator = (numerator/g1)*(f.numerator/g2);
    denominator = (denominator/g2)*(f.denominator/g1);
    sign = sign*f.sign;
    return *this;
  }

  const Fraction operator/=(const Fraction f) {
    assert(f.sign != 0);
    if (sign == 0) return Fraction(0, 1, 0, true);
    long long g1 = __gcd(numerator, f.numerator);
    long long g2 = __gcd(denominator, f.denominator);
    numerator = (numerator/g1)*(f.denominator/g2);
    denominator = (denominator/g2)*(f.numerator/g1);
    sign = sign*f.sign;
    return *this;
  }

  const bool operator==(const Fraction f) {
    return (numerator == f.numerator && denominator == f.denominator && sign == f.sign);
  }
  const bool operator<(const Fraction f) {
    long long g1 = __gcd(numerator, f.numerator);
    long long g2 = __gcd(denominator, f.denominator);
    return sign*(numerator/g1)*(f.denominator/g2) < f.sign*(f.numerator/g1)*(denominator/g2);
  }
  const bool operator<=(const Fraction f) {
    long long g1 = __gcd(numerator, f.numerator);
    long long g2 = __gcd(denominator, f.denominator);
    return sign*(numerator/g1)*(f.denominator/g2) <= f.sign*(f.numerator/g1)*(denominator/g2);
  }
  const bool operator>(const Fraction f) {
    long long g1 = __gcd(numerator, f.numerator);
    long long g2 = __gcd(denominator, f.denominator);
    return sign*(numerator/g1)*(f.denominator/g2) > f.sign*(f.numerator/g1)*(denominator/g2);
  }
  const bool operator>=(const Fraction f) {
    long long g1 = __gcd(numerator, f.numerator);
    long long g2 = __gcd(denominator, f.denominator);
    return sign*(numerator/g1)*(f.denominator/g2) <= f.sign*(f.numerator/g1)*(denominator/g2);
  }

  friend ostream &operator<<(std::ostream &out, const Fraction &f) {
    if (f.sign == 0ll) {
      out << 0;
      return out;
    } else if (f.sign == 1ll) {
      out << f.numerator << "/" << f.denominator;
      return out;
    } else {
      out << "-" << f.numerator << "/" << f.denominator;
      return out;
    }
  }
};

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int N, K; cin >> N >> K;
  vi A(N);
  rep(i, 0, N) cin >> A[i];
  sort(All(A));

  int ng = 0, ok = A.back();
  while (abs(ok - ng) > 1) {
    int mid = (ok+ng)/2;
    int k = 0;
    rep(i, 0, N) {
      int a = A[i];
      k += ((a+mid-1) / mid)-1;
    }

    if (k <= K) {
      ok = mid;
    } else {
      ng = mid;
    }
  }

  cout << ok << endl;


  return 0;
};


Measured memory_bytes: 4044