#include <bits/stdc++.h>
using namespace std;
const int kn = 200005;
const int N = 1e5 + 1;
const int mod = 1e9 + 7;
int a[101], m, n;
bool ahihi(int t) {
  int sums = 0;
  for (int i = 1; i <= n; i++) sums += max(a[i] - (i - 1) / t, 0);
  if (sums >= m) return true;
  return false;
}
bool option(int t, int t2) { return t > t2; }
signed main() {
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  sort(a + 1, a + n + 1, option);
  for (int i = 1; i <= n; i++) {
    if (ahihi(i)) {
      printf("%d", i);
      return 0;
    }
  }
  printf("-1");
}
