#include <bits/stdc++.h>

using namespace std;

#define INF 100000000
#define YJ 1145141919
#define INF_INT_MAX 2147483647
#define INF_LL 9223372036854775
#define INF_LL_MAX 9223372036854775807
#define EPS 1e-10
#define MOD 10000
#define Pi acos(-1)
#define LL long long
#define ULL unsigned long long
#define LD long double

#define int long long

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(a)  begin((a)), end((a))
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())

const int MAX_N = 395;
const int MAX_M = 25;
const int MAX_K = 10005;
const int MAX_A = 305;

int N, M, K;
int A[MAX_N];
int dp[MAX_N][2*MAX_M][MAX_A];

signed main()
{
  cin >> N >> M >> K;
  REP(i,N+1) {
    cin >> A[i];
  }

  dp[0][0][0] = K;

  REP(i,N+1) {
    REP(j,2*M+1) {
      REP(k,MAX_A) {
        dp[i+1][j][k] = max(dp[i+1][j][k], dp[i][j][k]);

        if(j%2 == 0) { //買い
          dp[i+1][j+1][(k+dp[i][j][k]) % A[i]] = max(dp[i+1][j+1][(k+dp[i][j][k]) % A[i]], (k+dp[i][j][k])/A[i]);  
        } else { //売り
          dp[i+1][j+1][0] = max(dp[i+1][j+1][0], dp[i][j][k]*A[i] + k);  
        }
      }
    }
  }

  int ans = 0;
  REP(i,2*M+1) {
    if(i%2 == 0) {
      ans = max(ans, dp[N+1][i][0]);
    }
  }

  cout << ans << endl;

  return 0;
}