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