#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  long long m;
  cin >> n >> m;
  vector<long long> a(n);
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  long long sum = std::accumulate(a.begin(), a.end(), 0);
  if (sum < m) {
    cout << -1 << endl;
    return 0;
  }
  sort(a.begin(), a.end(), greater<long long>());
  for (int i = 1; i <= n; ++i) {
    int len = (n + i - 1) / i;
    long long sum = 0;
    for (int j = 0; j < len; ++j) {
      for (int k = 0; k < i; ++k) {
        int idx = j * i + k;
        if (idx < n) {
          sum += max(a[idx] - j, 0LL);
        }
      }
    }
    if (sum >= m) {
      cout << i << endl;
      break;
    }
  }
  return 0;
}
