#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m, i, j;
  cin >> n >> m;
  long long a[n], sum = 0;
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n, greater<long long>());
  long long temp = 0, ans = 0;
  for (i = 1; i <= n; i++) {
    temp = 0;
    long long p = 0, q = 0;
    for (j = 0; j < n; j++) {
      long long y = 0;
      temp += max(y, a[j] - j / i);
    }
    if (temp >= m) {
      cout << i;
      return 0;
    }
  }
  cout << "-1";
}
