inlinevoidRMQ(){ for (int j = 0; j < 18; j++) for (int i = 1; i <= n; i++) if ((t = (1 << j) + i) <= n) f[i][j + 1] = MAX(f[i][j], f[t][j]); }
inlineintquery(int x, int y){ int k = log(y- x + 1) / log(2); returnMAX(f[x][k], f[y - (1 << k) + 1][k]); }
intmain(){ scanf("%d%d", &n, &w); for (int i = 1; i <= n; i++) scanf("%d", &f[i][0]);
RMQ();
longlong s; int i; for (i = 1; i <=n; i++) { s = 0; for (p = 1; p <= n; p += i) { t = p + i - 1; if (t > n) t = n; s += query(p, t) + 1; } if (s - 1 <= w) break ; } printf("%d\n", i); return0; }