Edge Groups
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld

题目描述

Given an undirected connected graph of n vertices and n-1 edges, where n is guaranteed to be odd. You want to divide all the n-1 edges to groups under following constraints:

  • There are exactly 2 edges in each group
  • The 2 edges in the same group share a common vertex


Determine the number of valid dividing schemes modulo 998244353. Two schemes are considered different if there are 2 edges that are in the same group in one scheme but not in the same group in the other scheme.

输入描述:

The first line contains one integer , denoting the number of vertices.

Following n-1 lines each contains two integers , denoting that vertex u,v are undirectedly connected by an edge.

It is guaranteed that n is odd and that the given graph is connected.

输出描述:

Output one line containing one integer, denoting the number of valid dividing schemes modulo 998244353.
示例1

输入

复制
7
1 2
1 3
1 7
4 7
5 7
6 7

输出

复制
3

说明

The 3 schemes are:
    The 3 edge groups are \{1\leftrightarrow 2, 1\leftrightarrow 3\}, \{1\leftrightarrow 7, 4\leftrightarrow 7\}, \{5\leftrightarrow 7, 6\leftrightarrow 7\}
    The 3 edge groups are \{1\leftrightarrow 2, 1\leftrightarrow 3\}, \{1\leftrightarrow 7, 5\leftrightarrow 7\}, \{4\leftrightarrow 7, 6\leftrightarrow 7\}
    The 3 edge groups are \{1\leftrightarrow 2, 1\leftrightarrow 3\}, \{1\leftrightarrow 7, 6\leftrightarrow 7\}, \{4\leftrightarrow 7, 5\leftrightarrow 7\}