#include <bits/stdc++.h>
using namespace std;
const int N = 105;
int in[N];
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  for (int i = 0; i < n; ++i) scanf("%d", in + i);
  sort(in, in + n, greater<int>());
  for (int i = 1; i <= n; ++i) {
    int value = 0;
    for (int j = 0; j < n; ++j) {
      value += max(0, in[j] - (j / i));
    }
    if (value >= m) return !printf("%d\n", i);
  }
  puts("-1");
}
