| Kotlin Heroes: Episode 13 |
|---|
| Finished |
You are given a tree consisting of $$$n$$$ vertices. Initially, none of the vertices of the tree are colored.
You can perform the following operation: choose any two vertices $$$u$$$ and $$$v$$$ (you are allowed to choose $$$u=v$$$) and color all the vertices on the path between them (including the endpoints) with color $$$i$$$, where $$$i$$$ is the index of the operation you are performing (that is, the first operation uses color $$$1$$$, the second uses color $$$2$$$, and so on). If any vertex on the path has already been colored before, its color changes to the new one.
We call the coloring of the tree complete if for each vertex, at least one operation has colored it.
Your task is to calculate two values:
The first line contains a single integer $$$n$$$ ($$$3 \le n \le 32$$$) — the number of vertices in the tree.
The next $$$(n-1)$$$ lines contain two integers $$$x_i$$$ and $$$y_i$$$ ($$$1 \le x_i, y_i \le n$$$; $$$x_i \ne y_i$$$) — the endpoints of the next edge of the tree.
Additional constraint on the input: the edges define a valid tree with $$$n$$$ vertices.
Print two integers — the minimum number of operations and the number of distinct complete colorings that can be obtained with the minimum number of operations. Since the second number can be very large, output it modulo $$$998244353$$$.
31 22 3
1 1
51 32 15 11 4
2 6
41 42 44 3
2 9
54 21 53 44 1
2 11
107 99 34 28 77 108 54 18 26 8
3 270
| Name |
|---|


