#include using namespace std; #define int long long const int p=998244353; int po(int a,int b) {if(b==0) return 1; if(b==1) return a; if(b%2==0) {int u=po(a,b/2);return (u*1LL*u)%p;} else {int u=po(a,b-1);return (a*1LL*u)%p;}} int inv(int x) {return po(x,p-2);} mt19937 rnd; #define app push_back #define all(x) (x).begin(),(x).end() #ifdef LOCAL #define debug(...) [](auto...a){ ((cout << a << ' '), ...) << endl;}(#__VA_ARGS__, ":", __VA_ARGS__) #define debugv(v) do {cout<< #v <<" : {"; for(int izxc=0;izxc > A) { if(A.empty()) return 1; int n=A.size();int m=A[0].size(); for(int i=0;i > A) { int n=A.size(); vector > B; for(int i=0;i > C; for(int i=0;i > collapse(vector > A) { int n=A.size(); vector > B(n-1,vector(n-1,0)); for(int i=0;i > A) { return trees(collapse(A)); } int32_t main() { ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0); int k;cin>>k; int res[k][2]; for(int i=0;i>n>>m; vector > A(n,vector(n,0)); for(int i=0;i>x>>y;--x;--y;A[x][y]=1;A[y][x]=1; } int a1=trees(A);int a2=trees12(A); res[i][0]=(2*a1+a2)%p;res[i][1]=a1; debug(res[i][0],res[i][1]); } int dp[2]={1,0}; for(int i=0;i