#!/usr/bin/ python3.8 import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines import itertools N, V, *C = map(int, read().split()) C = tuple(itertools.accumulate(C)) V -= N answer = C[-1] U = 10010 # cost -> value INF = 10 ** 18 dp = [INF] * U dp[0] = 0 for i, x in enumerate(C, 1): for j in range(i, U): c = dp[j - i] + x if dp[j] > c: dp[j] = c rate = [x / i for i, x in enumerate(C, 1)] n = rate.index(min(rate)) + 1 k = max(0, (V - U) // n) answer += k * C[n - 1] if V > 0: answer += dp[V - k * n] print(answer)