#!/usr/bin/env python3 # from typing import * import sys import io import math import collections import decimal import itertools import bisect import heapq def input(): return sys.stdin.readline()[:-1] # sys.setrecursionlimit(1000000) # _INPUT = """3 2 # 1 2 0 0 0 0 0 0 0 # """ # sys.stdin = io.StringIO(_INPUT) INF = 10**10 N, K = map(int, input().split()) C = list(map(int, input().split())) A = [] for i in range(9): A += [i+1] * C[i] dp = [[0] * K for _ in range(1<