#include using namespace std; #include using namespace atcoder; using mint=modint998244353; vector nim_prod_table(256, vector(256)); vector nim_inv_table(256); void nim_prod_precalc() { nim_prod_table[0][0]=0; nim_prod_table[0][1]=0; nim_prod_table[1][0]=0; nim_prod_table[1][1]=1; for(int d=0;d<3;++d){ int p=1<>p; unsigned long long a_l=a-(a_h<>p; unsigned long long b_l=b-(b_h<>p; unsigned long long a_l=a-(a_h<>p; unsigned long long b_l=b-(b_h<>p; unsigned long long a_l=a-(a_h<> & m, vector & exists) { 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; vector exists(n); auto m=h; 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; } for(int i=0;i0); } m=h; int rank=gauss(t, n, m, exists); if(n%2>0){ if(count%2>0){ ans+=mint(932051910).pow(count-rank); } else { ans-=mint(932051910).pow(count-rank); } } else { if(count%2>0){ ans-=mint(932051910).pow(count-rank); } else { ans+=mint(932051910).pow(count-rank); } } } cout << ans.val() << endl; return 0; }