import sys input = sys.stdin.readline N,M,K=map(int,input().split()) A=[int(input()) for i in range(N+1)] DP=[[-1<<30]*1000 for i in range(M+1)] DP[0][0]=K for a in A: NDP=[[-1<<30]*1000 for i in range(M+1)] for i in range(M+1): for j in range(1000): if DP[i][j]<0: continue now=DP[i][j] NDP[i][j]=max(NDP[i][j],now) for k in range(now//a+1): NDP[i][j+k]=max(NDP[i][j+k],now-a*k) for k in range(j+1): if i+1<=M: NDP[i+1][j-k]=max(NDP[i+1][j-k],now+a*k) DP=NDP ANS=0 for i in range(M+1): for j in range(500): ANS=max(ANS,DP[i][j]) print(ANS)