import itertools N, V = map(int, input().split()) packs = list(map(int, input().split())) com = [i + 1 for i in range(V - N + 1)] * N com_list = sorted(list(set(itertools.combinations(com, N))), reverse=True) com_list_v = [] for c in com_list: temp = sorted(c, reverse=True) if sum(temp) == V and temp not in com_list_v: com_list_v.append(temp) min_price = float('inf') if N >= V: min_price = sum(packs) else: for v in com_list_v: tmp = 0 for i in range(len(v)): tmp += packs[i] * v[i] if min_price > tmp: min_price = tmp print(min_price)