#include <bits/stdc++.h>
using namespace std;
long long n, m, sum = 0;
vector<long long> C;
int main() {
  cin >> n >> m;
  C.resize(n);
  for (int i = 0; i < n; i++) {
    cin >> C[i];
    sum += C[i];
  }
  if (sum < m) return cout << -1, 0;
  sort(C.rbegin(), C.rend());
  for (int i = 1; i <= sum; i++) {
    long long tsum = 0;
    for (int j = 0; j < n; j++) tsum += max(0ll, C[j] - j / i);
    if (tsum >= m) return cout << i, 0;
  }
}
