#include <bits/stdc++.h>
using namespace std;
int num[105];
bool cmp(int a, int b) { return a > b; }
int main() {
  int n, m;
  long long int sum = 0;
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    cin >> num[i];
    sum += num[i];
  }
  if (sum < m) {
    cout << "-1" << endl;
  } else {
    sum = 0;
    int cnt = 0;
    int i;
    bool prime;
    sort(num + 1, num + 1 + n, cmp);
    for (i = 1; i <= n; i++) {
      sum = 0;
      cnt = 0;
      prime = false;
      for (int x = 1; x <= n; x++) {
        sum += max(0, num[x] - cnt);
        if (x % i == 0) {
          cnt++;
        }
        if (sum >= m) {
          prime = true;
          break;
        }
      }
      if (prime) {
        break;
      }
    }
    cout << i << endl;
  }
  return 0;
}
