#include <bits/stdc++.h>
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4")
using namespace std;
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  vector<int> arr;
  for (auto i = 0; i <= n - 1; i += 1) {
    int item;
    scanf("%d", &item);
    arr.push_back(item);
  }
  sort(arr.rbegin(), arr.rend());
  int mn = 1000000007;
  for (auto k = 1; k <= n; k += 1) {
    int course = 0;
    for (auto i = 0; i <= n - 1; i += 1) {
      course += max(0, (arr[i] - (i) / k));
      if (course >= m) {
        mn = min(mn, k);
        break;
      }
    }
  }
  if (mn == 1000000007)
    printf("-1\n");
  else
    printf("%d\n", mn);
  return 0;
}
