# Enter your code here. Read input from STDIN. Print output to STDOUT n,k = map(int,raw_input().split(' ')) c = map(int,raw_input().split(' ')) def recurse(c,k): n = len(c) if n ==1: return c[0] else: runsum = [0]*n for i in range(n): for j in range(-k,k+1): if (i+j>=0) and (i+j0: c0 += recurse(c[:p1],k) if p2