#include using namespace std; #include using namespace atcoder; using mint=modint998244353; unsigned long long nim_product(unsigned long long a, unsigned long long b, int d=6) { if(a==0 || b==0){ return 0; } if(a==1){ return b; } if(b==1){ return a; } --d; unsigned long long p=1<>p; unsigned long long a_l=a-(a_h<>p; unsigned long long b_l=b-(b_h<0){ if(e%2>0){ p=nim_product(p, a); } a=nim_product(a, a); e/=2; } return p; } int gauss(int r, int c, vector> & m) { int rank=0; for(int i=0;i0){ pivot=j; break; } } if(pivot==-1){ continue; } swap(m[pivot], m[rank]); auto inv=nim_inv(m[rank][i]); m[rank][i]=1; for(int k=rank+1;k> n >> t; vector h(t, vector(n)); for(int i=0;i> h[i][j]; --h[i][j]; } } mint ans=0; for(unsigned int s=0;s<(unsigned int)(1<0){ --ans; } else { ++ans; } continue; } if(count==1){ if(n%2>0){ ++ans; } else { --ans; } continue; } vector m(t, vector(count)); int cur=0; for(int j=0;j0){ for(int i=0;i0){ if(count%2>0){ ans+=mint(2).pow(64).pow(count-rank); } else { ans-=mint(2).pow(64).pow(count-rank); } } else { if(count%2>0){ ans-=mint(2).pow(64).pow(count-rank); } else { ans+=mint(2).pow(64).pow(count-rank); } } } cout << ans.val() << endl; return 0; }