#include using namespace std; #define REP(i,a,n) for(int i=(a); i<(int)(n); i++) #define rep(i,n) REP(i,0,n) #define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it) #define ALLOF(c) (c).begin(), (c).end() typedef long long ll; typedef unsigned long long ull; struct ST { ll diff; int s, e; }; bool operator<(const ST& a, const ST& b){ if(a.diff == b.diff) return a.s < b.s; return a.diff > b.diff; } int main(){ int N, M; ll K; cin >> N >> M >> K; vector v; rep(i,N+1){ ll a; cin >> a; v.push_back(a); } vector w; rep(i,v.size()){ REP(j,i+1,v.size()){ w.push_back((ST){v[j]-v[i],i,j}); } } sort(ALLOF(w)); vector> ret; vector memo(N+10,0); rep(i,w.size()){ if(w[i].diff <= 0) continue; bool ok = true; REP(j,w[i].s,w[i].e+1){ if(memo[j] == 1) ok = false; } if(ok && M>0){ ret.push_back(make_pair(w[i].s, w[i].e)); REP(j,w[i].s,w[i].e+1){ memo[j] = 1; } M--; } } sort(ALLOF(ret)); rep(i,ret.size()){ ll a = v[ret[i].first]; ll b = v[ret[i].second]; ll x = K/a; K -= x*a; K += x*b; } cout << K << endl; return 0; }