#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int mod=998244353; 
ll quick(ll a,ll b){
    ll ans=1;
    if(b==0){
        return 1;
    }
    while(b>0){
        if(b&1){
            ans=a*ans%mod;
        }
        b>>=1;
        a=a*a%mod;
    }
    return ans;
}
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int t;
    cin>>t;
    ll n;
    int x;
    while(t--){
        cin>>n;
        for(int i=0;i<n;i++){
            cin>>x;
        }
        cout<<quick(2,n-1)%mod<<endl;
    }
    return 0;
}