#include #include #include #include #include #include using namespace std; typedef long long LL; const LL mod = 998244353; const int maxn = 100005; LL a[maxn],mul[30]; const LL P=30007; typedef struct HASHMAP { int head[P],nxt[maxn],size; LL Hash[maxn]; LL cnt[maxn]; HASHMAP() { memset(head,-1,sizeof(head)); } void clear() { memset(head,-1,sizeof(head)); size=0; } int get(LL a) { LL x=a%P; for(int i=head[x];i!=-1;i=nxt[i]) { if(Hash[i]==a) return i; } return -1; } int New(LL a){ LL x=a%P; Hash[size]=a; nxt[size]=head[x]; cnt[size]=0; head[x]=size++; return size-1; } void push(LL a,LL num) { int x=get(a); if(x==-1) x=New(a); cnt[x]=(cnt[x]+num)%mod; } LL operator [] (LL i) { int x=get(i); if(x==-1) return 0; return cnt[x]; } }HASHMAP; HASHMAP mp; int n; int main() { int t,ca=0; cin>>t; mul[0]=1; for(int i=1;i<=30;i++) mul[i]=mul[i-1]*2; while(t--) { LL ret=0; cin>>n; for(int i=0;i