from numpy import prod for i in range(int(input())): n,k = map(int,input().split()) a = list(map(int,input().split())) a[0] -= k print(prod(a))