#include <bits/stdc++.h>
using namespace std;
int cmp(int x, int y) { return x > y; }
int main() {
  int n, m;
  while (~scanf("%d%d", &n, &m)) {
    int a[105], k[105];
    for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
    sort(a + 1, a + n + 1, cmp);
    int d = 1, ans = 0;
    while (d <= n) {
      memset(k, 0, sizeof(k));
      for (int i = 1; i <= n; i++) {
        k[i % d] += max(0, a[i] - ((i - 1) / d));
      }
      ans = 0;
      for (int i = 0; i < d; i++) ans += k[i];
      if (ans >= m) break;
      d++;
    }
    if (ans && d <= n)
      printf("%d\n", d);
    else
      printf("-1\n");
  }
}
