
#include <bits/stdc++.h>
using namespace std;

#define file "o"
#define ff(i, a, b) for(auto i=(a); i<=(b); ++i)
#define ffr(i, b, a) for(auto i=(b); i>=(a); --i)
#define nl "\n"
#define ss " "
#define pb emplace_back
#define fi first
#define se second
#define sz(s) (int)s.size()
#define all(s) (s).begin(), (s).end()
#define ms(a,x) memset(a, x, sizeof (a))
#define cn continue
#define re exit(0)

typedef __int128_t int128;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<pii> vpii;
typedef vector<pll> vpll;

mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
ll ran(ll l, ll r)
{
    return uniform_int_distribution<ll> (l, r)(rng);
}

inline void rf()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr); cout.tie(nullptr);
    if(fopen(file".inp","r"))
    {
        freopen(file".inp","r",stdin);
        freopen(file".out","w",stdout);
    }
}

const int mod=998244353;
const int maxn=2e5+15;
const int128 inf=2000000000000000005LL;

int n;
int128 k, a[maxn];

inline bool check(int128 x)
{
    int128 cnt=0;
    ff(i, 1, n) if(x>a[i])
    {
        int128 need=(x-a[i])/i;
        if((int128)i*need+a[i]<x) ++need;
        cnt+=need;
    }
    return cnt<=k;
}

signed main()
{
    rf();
    ll in_k;
    cin>>n>>in_k; 
    k=in_k;
    
    ff(i, 1, n) 
    {
        ll in_a; 
        cin>>in_a; 
        a[i]=in_a;
    }
    
    int128 l=0, r=inf, ans=-1;
    while(l<=r)
    {
        int128 mid=(l+r)>>1;
        if(check(mid)) ans=mid, l=mid+1;
        else r=mid-1;
    }
    
    cout<<(long long)ans;
    re;
}