#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
const int N=1000005;
int n,a[N],b[N];
long long m,f[N],s[N];
int ok(int w)
{
long long ans=0;
for(int i=1;i<=n;i++)
b[i]=a[i];
for(int i=2;i<=n;i++)
if(b[i]-b[i-1]>w)
ans+=b[i]-b[i-1]-w,b[i]=b[i-1]+w;
for(int i=n-1;i>=1;i--)
if(b[i]-b[i+1]>w)
ans+=b[i]-b[i+1]-w,b[i]=b[i+1]+w;
for(int i=1;i<=n;i++)
s[i]=s[i-1]+b[i];
if(ans>m)
return 0;
for(int i=1,j=1;i<=n;i++)
{
while(j<i&&b[j]<=1ll*(i-j)*w)
j++;
f[i]=s[i-1]-s[j-1]-1ll*(i-j)*(i-j+1)/2*w;
}
for(int i=n,j=n;i;i--)
{
while(j>i&&b[j]<=1ll*(j-i)*w)
j--;
f[i]+=s[j]-s[i]-1ll*(j-i)*(j-i+1)/2*w;
}
for(int i=1;i<=n;i++)
if(b[i]+f[i]+ans<=m)
return i;
return 0;
}
int main()
{
int l=0,r=0,ans=0;
scanf("%d%lld",&n,&m);
for(int i=1;i<=n;i++)
scanf("%d",&a[i]),r=max(r,a[i]);
while(l<=r)
{
int mid=(l+r)>>1;
if(ok(mid))
r=mid-1,ans=mid;
else
l=mid+1;
}
printf("%d %d",ok(ans),ans);
return 0;
}