n, m, k = map(int, input().split()) a = list(map(int, input().split())) dp = [[0 for _ in range(k + 1)] for _ in range(n + 1)] a.sort() #dp[i][j] = i番目までのカードを見て、j枚選んでいるM以下の最大値 for i in range(1, n + 1): for j in range(k + 1): for l in range(0, k - j + 1): if dp[i - 1][j] + a[i - 1] * l > m: continue dp[i][j + l] = max(dp[i][j + l], dp[i - 1][j] + a[i - 1] * l) ans = 0 for i in range(n + 1): for j in range(k + 1): if ans < dp[i][j]: ans = dp[i][j] print(ans)