# 简单环

xiaoxiao2021-02-28  28

#include <iostream> #include <cstdio> #include <cstring> #include <string> #include <algorithm> #include <cmath> #include <map> #include <set> #include <stack> #include <queue> #include <vector> #include <bitset> #include <functional> using namespace std; #define LL long long const int INF = 0x3f3f3f3f; const int mod = 998244353; int dp[25][1 << 22]; int ans[25]; int x[25][25]; int a[25], b[25], cnt1, cnt2; int n, m, k, u, v; int main() { while (~scanf("%d%d%d", &n, &m, &k)) { for (int i = 1; i <= m; i++) { scanf("%d %d", &u, &v); u--; v--; x[u][v] = x[v][u] = 1; } for (int i = 0; i < n; i++) dp[i][1 << i] = 1; for (int i = 1; i < (1 << n); i++) { cnt1 = cnt2 = 0; for (int j = 0; j < n; j++) { if (i & (1 << j)) a[cnt1++] = j; else if (cnt1) b[cnt2++] = j; } for (int j = 0; j < cnt1; j++) { if (x[a[0]][a[j]] && cnt1 > 2) (ans[cnt1 % k] += dp[a[j]][i]) %= mod; for (int p = 0; p < cnt2; p++) { if (x[a[j]][b[p]]) (dp[b[p]][i | (1 << b[p])] += dp[a[j]][i]) %= mod; } } } for (int i = 0; i < k; i++) printf("%d\n", 1LL * ans[i] * 499122177 % mod); } return 0; }