409217: GYM103462 I Iaom and Chicken feet
Memory Limit:256 MB
Time Limit:1 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
I. Iaom and Chicken feettime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output
Baom likes chicken very much.
One day ,while he was thinking a problem on tree he found it looks like chicken's feet.
He fall into thinking,how much chicken feet are there on the tree.
The "chicken feet" is a subgraph of given tree which shapes like the picture above
Baom wonder the number of "chicken feet" all over the tree.Two "feet"s are consider the same iff the set of edges of "chicken feet"s are the same.
InputThe first line contains one integer $$$n (1\le n \le 5 \cdot 10^5)$$$ —The number of nodes each of next $$$n-1$$$ line contains a description of an edge: two integers $$$u$$$ and $$$v(1\le u,v \le n,u \ne v)$$$ The given edges form a tree.
OutputPrint a single integer — the number of "chicken feet" modulo $$$998244353$$$.
ExampleInput7 1 2 2 3 2 4 5 4 6 4 7 4Output
1