n, v = map(int, input().split()) c = list(map(int, input().split())) for i in range(1, n): c[i] += c[i - 1] v -= n if v <= 0: print(c[-1]) exit(0) num_cost_pairs = list(enumerate(c, 1)) class Rational: def __init__(self, p): # p[1] / p[0] self.n = p[1] self.d = p[0] def __lt__(self, r): return self.n * r.d < self.d * r.n num_cost_pairs.sort(key=Rational) (mn, mc), *others = num_cost_pairs print(mn, mc, others) # can assume each pair in others not be taken >100 times INF = 10 ** 18 MX = 100 * 100 dp = [INF] * (MX + 1) dp[0] = 0 for i in range(MX): for num, cost in others: j = i + num if j <= MX: dp[j] = min(dp[j], dp[i] + cost) ans = INF for vi in range(v % mn, min(MX, v) + 1, mn): ans = min(ans, dp[vi] + (v - vi) // mn * mc) print(ans + c[-1])