Dense forest in the Western suburbs helps you break loose.
西郊有密林,助君出重围。
Given a weighted undirected simple graph with $n$ vertices and $m$ positive-weighted edges. Sum up the weight of the minimum spanning forest for each of its spanning subgraph, and print the value modulo $998244353$ as answer.
A minimum spanning forest of a weighted undirected graph $G$ with vertex set $V$ and edge set $E$ is defined as follows:
-
It's a subset of $E$ (not necessarily non-empty or different from $E$), denoted as $S$.
-
Any pair of vertices $(u, v)$ which can reach each other in $G$ can still reach each other only using edges in $S$.
-
$S$ is the subset with minumum weight among all subsets satisfying the above two conditions. The weight of $S$ is the sum of weight of all edges in it.
A spanning subgraph of $G$ is a graph with vertex set $V$ and edge set a subset of $E$ (not necessarily non-empty or different from $E$).