#include <bits/stdc++.h>
using namespace std;
const int MX = 1e6 + 5;
const int INF = 1e9;
const int M = 1000000007;
vector<int> adj[100005];
vector<int> vis(100005, 0);
void solve() { return; }
int main() {
  ios_base::sync_with_stdio(false);
  int t = 1;
  while (t--) {
    int n, m;
    cin >> n >> m;
    int ar[n];
    int sum = 0;
    for (int i = 0; i < n; i++) {
      cin >> ar[i];
      sum += ar[i];
    }
    if (sum < m) {
      cout << -1;
      return 0;
    } else if (sum == m) {
      cout << n;
      return 0;
    }
    sort(ar, ar + n);
    for (int i = 1; i <= n; i++) {
      int dec = 0, res = 0;
      for (int j = 0; j < i; j++) {
        dec = 0;
        for (int k = n - 1 - j; k >= 0; k -= i) {
          res += max(0, ar[k] - dec);
          dec++;
        }
      }
      if (res >= m) {
        cout << i;
        return 0;
      }
    }
  }
  return 0;
}
