#include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; const ll INF=1LL<<60; typedef pair P; typedef pair PP; const ll MOD=1e9+7; int main(){ int N,K; ll M; cin>>N>>M>>K; vector A(N); for(int i=0;i>A[i]; } /* sort(A.begin(),A.end()); reverse(A.begin(),A.end()); ll ans=min(A[0]*K,M); cout<,greater

> pq; //priority_queue,greater> pq; //unordered_set st; map st; //st.insert(0); pq.emplace(0,0); while(!pq.empty()){ auto [v,d]=pq.top(); pq.pop(); if(st.count(v) && st[v]<=d) continue; //st[v]>d //st.insert(v); st[v]=d; if(d+1<=K){ for(int i=0;iM) continue; if( !st.count(v+A[i]) || st[v+A[i]]>(d+1) ){ pq.emplace(v+A[i],d+1); } } } } /* ll ans=0; for(ll v:st){ ans=max(ans,v); } */ ll ans= st.rbegin()->first; cout<