#include <bits/stdc++.h>
using namespace std;
const int lim = 1e2 + 2;
int arr[lim];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < n; ++i) cin >> arr[i];
  sort(arr, arr + n, greater<int>());
  for (int d = 1; d <= n; ++d) {
    int ans = 0;
    for (int i = 0; i < n; ++i) ans += max(0, arr[i] - i / d);
    if (ans >= m) {
      cout << d;
      return 0;
    }
  }
  cout << -1;
  return 0;
}
