import operator as op
from functools import reduce

N, K = map(int, input().split())
cookies = list(map(int, input().split()))
happines = (sum(cookies) - N) * K
multiplied = 1

def ncr(n, r):
    r = min(r, n-r)
    numer = reduce(op.mul, range(n, n-r, -1), 1)
    denom = reduce(op.mul, range(1, r+1), 1)
    return numer / denom

for i in cookies:
    print(ncr(N,i))
    multiplied = multiplied * ncr(N, i)
res = int(happines * multiplied)
print(res)