l
m
#include<iostream>
#include<string>
#include<sstream>
using namespace std;
int a[100] = { 0 };
int main()
{ string s;
int min, total;
cin >> min;
cin >> total;
cin.ignore();
getline(cin, s);
stringstream ss(s);
int i = 0;
while (ss >> a[i])
{
i++;
}
int pre = 0;
int m = 0;
for (int j = 0; j < i; j++)
{
if (a[j] <= total)
{
total = total - a[j];
}
else {
if ( (total + a[j]+pre)% 2 == 0)
m = max(m, (-total + a[j]+pre)/(j));
else
m = max(m, (-total + a[j] + pre) / (j)+1);
pre = a[j] + pre;
}
}
cout << m;
return 0;
}