import sys input = lambda : sys.stdin.readline().rstrip() sys.setrecursionlimit(2*10**5+10) write = lambda x: sys.stdout.write(x+"\n") debug = lambda x: sys.stderr.write(x+"\n") writef = lambda x: print("{:.12f}".format(x)) n,m = list(map(int, input().split())) c = list(map(int, input().split())) c.insert(0,0) c.append(0) a = [[0]*n for _ in range(n)] b = c[:] for i in range(n): for j in range(1,m+1): if i+j