#include #include const int Mod = 998244353; typedef struct Edge { struct Edge *next; int v; } edge; int main() { int i, N, M, u, w; edge *adj[200001] = {}, e[400001], *p; scanf("%d", &N); for (i = 0; i < N - 1; i++) { scanf("%d %d", &u, &w); e[i*2].v = w; e[i*2+1].v = u; e[i*2].next = adj[u]; e[i*2+1].next = adj[w]; adj[u] = &(e[i*2]); adj[w] = &(e[i*2+1]); } int par[200001] = {}, q[200001], head, tail; par[1] = 1; q[0] = 1; for (head = 0, tail = 1; head < tail; head++) { u = q[head]; for (p = adj[u]; p != NULL; p = p->next) { w = p->v; if (par[w] == 0) { par[w] = u; q[tail++] = w; } } } int j, ww, size[200001], *dp[200001], a[524288], b[524288], c[524288]; long long tmp; for (head--; head >= 0; head--) { u = q[head]; for (p = adj[u], size[u] = 1; p != NULL; p = p->next) { w = p->v; if (par[u] == w) continue; size[u] += size[w]; } dp[u] = (int*)malloc(sizeof(int) * (size[u] + 1)); dp[u][0] = 0; dp[u][1] = 1; for (i = 2; i <= size[u]; i++) dp[u][i] = 0; size[u] = 1; for (p = adj[u]; p != NULL; p = p->next) { w = p->v; if (par[u] == w) continue; for (j = 1, tmp = 0; j <= size[w]; j++) tmp += (long long)dp[w][j] * j % Mod; for (i = size[u], tmp %= Mod; i > 0; i--) { for (j = 1; j <= size[w]; j++) { dp[u][i+j] += (long long)dp[u][i] * dp[w][j] % Mod; if (dp[u][i+j] >= Mod) dp[u][i+j] -= Mod; } dp[u][i] = dp[u][i] * tmp % Mod; } size[u] += size[w]; free(dp[w]); } } long long ans = 0; for (i = 1; i <= size[1]; i++) ans += (long long)dp[1][i] * i % Mod; printf("%lld\n", ans % Mod); fflush(stdout); return 0; }