{"raw_statement":[{"iden":"problem statement","content":"We have a tree $G$ with $N$ vertices numbered $1$ to $N$. The $i$\\-th edge of $G$ connects Vertex $a_i$ and Vertex $b_i$.\nConsider adding zero or more edges in $G$, and let $H$ be the graph resulted.\nFind the number of graphs $H$ that satisfy the following conditions, modulo $998244353$.\n\n*   $H$ does not contain self-loops or multiple edges.\n*   The diameters of $G$ and $H$ are equal.\n*   For every pair of vertices in $H$ that is not directly connected by an edge, the addition of an edge directly connecting them would reduce the diameter of the graph."},{"iden":"constraints","content":"*   $3 \\le N \\le 2 \\times 10^5$\n*   $1 \\le a_i, b_i \\le N$\n*   The given graph is a tree."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$\n$a_1$ $b_1$\n$\\vdots$\n$a_{N-1}$ $b_{N-1}$"},{"iden":"sample input 1","content":"6\n1 6\n2 1\n5 2\n3 4\n2 3"},{"iden":"sample output 1","content":"3\n\nFor example, adding the edges $(1, 5), (3, 5)$ in $G$ satisfies the conditions."},{"iden":"sample input 2","content":"3\n1 2\n2 3"},{"iden":"sample output 2","content":"1\n\nThe only graph $H$ that satisfies the conditions is $G$."},{"iden":"sample input 3","content":"9\n1 2\n2 3\n4 2\n1 7\n6 1\n2 5\n5 9\n6 8"},{"iden":"sample output 3","content":"27"},{"iden":"sample input 4","content":"19\n2 4\n15 8\n1 16\n1 3\n12 19\n1 18\n7 11\n11 15\n12 9\n1 6\n7 14\n18 2\n13 12\n13 5\n16 13\n7 1\n11 10\n7 17"},{"iden":"sample output 4","content":"78732"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}