#include <bits/stdc++.h>
using namespace std;
int n;
long long k;
int a[222222];
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
bool ck(long long m) {
  long long sum = 0;
  long long mul = 1;
  for (int i = 0; i < n; ++i) {
    if (a[i] > (k - sum) / mul || a[i] * mul == k - sum) {
      return true;
    }
    sum += mul * a[i];
    if (1.0 * mul / (i + 1) * (m + i) <= 1.0 * k) {
      long long g = gcd(m + i, i + 1);
      mul /= ((i + 1) / g);
      mul *= ((m + i) / g);
    } else {
      mul = k;
    }
  }
  return false;
}
int main() {
  cin >> n >> k;
  bool flag = false;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    if (a[i] >= k) {
      flag = true;
    }
  }
  if (flag) {
    cout << "0" << endl;
    return 0;
  }
  reverse(a, a + n);
  long long l = 1, r = 1e18;
  while (r - l > 1) {
    long long m = (l + r) / 2;
    if (ck(m)) {
      r = m;
    } else {
      l = m;
    }
  }
  cout << (ck(l) ? l : r) << endl;
  return 0;
}
