Froggy has an unrooted tree $$$T$$$ with $$$n$$$ vertices, where each vertex has an initial weight. Initially, the weight of vertex $$$i$$$ is $$$i$$$.
Froggy can perform at most 1 operation sequentially as follows:
Let $$$a_i$$$ denote the weight of vertex $$$i$$$ after all operations. How many distinct sequences $$$a_1, a_2, \cdots, a_n$$$ can Froggy obtain? Output the answer modulo $$$998244353$$$.
The first line contains a positive integer $$$T$$$ $$$(1 \leq T \leq 10^3)$$$, indicating the number of test cases.
For each test case, the first line contains an integer $$$n$$$ $$$(1 \leq n \leq 3000)$$$, representing the number of vertices in the tree.
The next $$$n-1$$$ lines each contain two positive integers $$$x, y$$$ $$$(1 \leq x, y \leq n, x \neq y)$$$, representing the two endpoints of an edge in tree $$$T$$$.
It is guaranteed that the sum of $$$n$$$ over all test cases in a single test point does not exceed $$$1.5 \times 10^4$$$.
For each test case, output one integer representing the answer modulo $$$998244353$$$.
351 21 31 41 561 21 31 42 52 661 22 32 43 54 6
23 80 155
| Название |
|---|


