#include
#include
using namespace std;
bool isPossible(int *A,int N,int K,int T,int current)
{
int painters=1;
int painted_boards=0;
for(int i=0;i<N;i++)
{
if((painted_boards+A[i])*current>T)
{
painters++;
painted_boards=A[i];
if(painters>K)
return false;
}
else
{
painted_boards=painted_boards+A[i];
}
}
return true;
}
int main() {
int N,K,T;
cin>>N>>K>>T;
int current=T;
int *A=new int[N];
for(int i=0;i<N;i++)
cin>>A[i];
int sum=0;
for(int i=0;i<N;i++)
sum=sum+A[i];
int Max_Time=sum*T;
int l=1*T;
int h=Max_Time;
int mid=0;
int ans=0;
while(l<=h)
{
mid=(l+h)/2;
if(isPossible(A,N,K,mid,current))
{
ans=mid;
l=mid+1;
}
else
h=mid-1;
}
cout<<ans;
}