#include #include #include #include using namespace std; using ll = long long; using ull = unsigned long long; #define rep(i,n) for(int i=0; i<(n); i++) using mll = atcoder::static_modint<998244353>; struct Frac{ ll b=0, d=1; }; bool operator<(Frac l, Frac r){ return l.b * r.d < l.d * r.b; } void testcase(){ int N,K; cin >> N >> K; vector A(N); rep(i,N) cin >> A[i]; ll sumA = 0; rep(i,N) sumA += A[i]; mll ans = 1; priority_queue Q; rep(i,N) Q.push(Frac{ A[i],1 }); rep(t,K){ Frac q = Q.top(); Q.pop(); ans = ans * (t+1) * q.b / q.d / sumA; Q.push(Frac{ q.b,q.d+1 }); } cout << ans.val() << "\n"; } int main(){ int T; cin >> T; while(T--) testcase(); return 0; } struct ios_do_not_sync{ ios_do_not_sync(){ ios::sync_with_stdio(false); cin.tie(nullptr); } } ios_do_not_sync_inst;