inline T read(){ T sum = 0, fl = 1; char ch = getchar(); for (; !isdigit(ch); ch = getchar()) if (ch == '-') fl = -1; for (; isdigit(ch); ch = getchar()) sum = sum * 10 + ch - '0'; return sum * fl; }
template <typename T>
inlinevoidwrite(T x){ if (x < 0) { putchar('-'), write<T>(-x); return; } static T sta[35]; ll top = 0; do { sta[top++] = x % 10, x /= 10; } while (x); while (top) putchar(sta[--top] + 48); }
inlineboolchk(ll q){ ll sum = 0; FOR(i, 1, n) { sum += min(q, a[i]); if (sum > m) return0; } return sum <= m; }
intmain(){ scanf("%lld%lld", &n, &m); FOR(i, 1, n) scanf("%lld", &a[i]), sum += a[i]; if (sum <= m) { log("infinite"); return0; } ll l = 0, r = sum, ret = -1; while (l <= r) { ll mid = (l + r) >> 1; if (chk(mid)) { ret = mid; l = mid + 1; } else r = mid - 1; } log("%lld\n", ret); return0; }