Independent Set (Sum)

시간 제한1초메모리 제한2048 MB

요약
트리의 공집합이 아닌 모든 독립 집합에 대해 (집합의 크기) 곱하기 (집합을 연결하는 최소 간선 수)의 합을 구한다.
난이도

어려움10점 중 8점

유형
트리, DFS, 동적 계획법, 조합론
정답자
아직 제출이 없습니다

문제

You are given a tree of NN nodes (numbered from 11 to NN). The edges are numbered from 11 to N−1N - 1; edge ii connects node U_iU\_i and V_iV\_i.

A non-empty set of nodes is independent if none of the nodes in the set are adjacent to each other. The following illustration provides an example of sets which are independent, and sets which are not. The nodes colored in red are the members of the set.

The score of an independent set can be calculated as the product of:

  • the number of nodes in the set, and
  • the minimum number of edges such that all nodes in the set are still connected.

The following illustration provides an example for calculating the score of an independent set. There are 22 nodes in the set. The minimum number of edges to connect all nodes in the set is 33, as shown by the edges colored in red. The score of this set is 2⋅3=62 \cdot 3 = 6.

Note that the score of an independent set consisting of only 11 node is 00.

Determine the sum of score over all non-empty independent sets within the tree. Since the result can be very large, calculate the answer modulo 998,244,353998\\, 244\\, 353.

입력

The first line consists of an integer NN (2≤N≤100,0002 ≤ N ≤ 100\\, 000).

Each of the next N−1N - 1 lines consists two integers U_iU\_i V_iV\_i (1≤U_i,V_i≤N1 ≤ U\_i , V\_i ≤ N). The input edges form a tree.

출력

Output a single integer representing the sum of score over all non-empty independent sets within the tree. Since the result can be very large, calculate the answer modulo 998,244,353998\\, 244\\, 353.

예제2

  1. 예제 1

    입력
    5
    1 2
    1 3
    3 4
    3 5
    
    예상 출력
    49
    
  2. 예제 2

    입력
    8
    1 2
    2 3
    3 4
    4 5
    5 6
    6 7
    7 8
    
    예상 출력
    616