#include using namespace std; using ll = long long; #define rep(i,n) for (int i=0;i<(int)(n);i++) int main(){ ll n,m,k; cin>>n>>m>>k; vector a(n); rep(i,n) cin>>a.at(i); a.push_back(0); sort(a.begin(),a.end()); set st1={0},st2={0}; int dv=k/2; rep(i,dv){ set st3; for(ll x:st1){ for(ll y:a){ st3.insert(x+y); } } swap(st1,st3); } rep(i,k-dv){ set st3; for(ll x:st2){ for(ll y:a){ st3.insert(x+y); } } swap(st2,st3); } ll ans=0; for(ll x:st2){ if(x>m) break; ll df=m-x; auto itr=st1.lower_bound(df); if(itr==st1.end()) itr--; ll y=*itr; if(x+y>m) continue; ans=max(ans,x+y); } cout<