#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.precision(10);
  int n, m;
  cin >> n >> m;
  vector<int> coffees(n);
  for (size_t i = 0; i < n; ++i) {
    cin >> coffees[i];
  }
  sort(begin(coffees), end(coffees), greater<int>());
  for (int d = 1; d <= n; ++d) {
    int sum = 0;
    for (int i = 0; i < n; ++i) {
      auto coffee = max(coffees[i] - i / d, 0);
      sum += coffee;
    }
    if (sum >= m) {
      cout << d << '\n';
      return 0;
    }
  }
  cout << -1 << '\n';
  return 0;
}
