#include <bits/stdc++.h>
using namespace std;
const long long int mod = 1000000007;
map<int, int> cnt;
set<int> key;
struct comp {
  bool operator()(pair<int, int> a, pair<int, int> b) {
    if (a.second != b.second) return a.second > b.second;
    return a.first > b.first;
  }
};
multiset<pair<int, int>, comp> heaps;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n, m;
  cin >> n >> m;
  long long int arr[n], sum = 0;
  for (long long int i = 0; i < n; i++) {
    cin >> arr[i];
    sum += arr[i];
  }
  if (sum < m) {
    cout << "-1\n";
    return 0;
  }
  sort(arr, arr + n, greater<long long int>());
  long long int ans = n;
  for (int i = n; i >= 1; i--) {
    vector<long long int> temp[i];
    long long int d = 0;
    for (int j = 0; j < n; j++) {
      temp[d].push_back(arr[j]);
      d++;
      d %= i;
    }
    long long int sums = 0;
    for (int j = 0; j < i; j++)
      for (int k = 0; k < temp[j].size(); k++) sums += max(0ll, temp[j][k] - k);
    if (sums >= m) ans = i;
  }
  cout << ans << endl;
  return 0;
}
