P = 998244353 nn = 202020 fa = [1] * (nn+1) fainv = [1] * (nn+1) for i in range(nn): fa[i+1] = fa[i] * (i+1) % P fainv[-1] = pow(fa[-1], P-2, P) for i in range(nn)[::-1]: fainv[i] = fainv[i+1] * (i+1) % P C = lambda a, b: fa[a] * fainv[b] % P * fainv[a-b] % P if 0 <= b <= a else 0 T = int(input()) for _ in range(T): N, K = map(int, input().split()) A = [int(a) for a in input().split()] su = sum(A) B = [K * a // su for a in A] su2 = sum(B) L = [(A[i] / (B[i] + 1), i) for i in range(N)] L.sort(key = lambda x: -x[0]) for k in range(K - su2): i = L[k][1] B[i] += 1 ans = fa[K] for i, b in enumerate(B): ans = ans * fainv[b] % P * pow(A[i], b, P) % P ans = ans * pow(su, (P - 2) * K, P) % P print(ans)