QOJ.ac

QOJ

Límite de tiempo: 1 s Límite de memoria: 256 MB Puntuación total: 100

#521. Defense Network

Estadísticas

Background

Although the alien invasion plan was successfully obtained, JYY unexpectedly discovered that the alien mothership's attacks on Earth are random! A defense network must be deployed on Earth as soon as possible to withstand the attacks from the alien mothership.

Description

The defense network on Earth consists of nodes and energy connections between them. The defense network can be viewed as a simple undirected graph $G(V, E)$ with $n$ nodes and $m$ edges, where each defense node corresponds to a node in $V$ and each energy connection corresponds to an edge in $E$. Furthermore, considering energy transmission efficiency during the construction of the defense network, each node in the defense network $G$ is contained in at most one simple cycle.

The alien mothership's attacks are random. After each attack begins, JYY selects some defense nodes $S \subseteq V$ based on the situation of the attack and connects these defense nodes using energy connections to activate a defense subnetwork. In other words, JYY selects a subset of edges $H(S) \subseteq E$ that satisfies:

  1. (Defense subnetwork connectivity) If we construct a new graph $G' = (V, H(S))$, i.e., using the edges in $H(S)$ to connect the nodes in $V$, then for any chosen defense nodes $x, y \in S$, they are connected in $G'$.
  2. (Defense subnetwork minimality) Under the condition that condition 1 is satisfied, the number of selected edges is minimized, i.e., $|H(S)|$ is minimized.

$H(S)$ is the Steiner Tree generated by the node set $S$ in graph $G$, and $|H(S)|$ is the minimum cost to activate the defense subnetwork. Considering the random nature of the alien mothership's attacks, JYY wants you to calculate the expected cost of activating the defense subnetwork:

$$\frac{1}{2^{|V|}} \sum_{S \subseteq V} |H(S)|$$

Input

The first line contains two integers $n$ and $m$, representing the number of nodes and edges in the graph, respectively.

The next $m$ lines each contain two integers $u, v$ ($1 \le u, v \le n$), representing an edge in the graph. The input is guaranteed to have no self-loops or multiple edges, and each node is contained in at most one simple cycle.

Output

Output a single line representing the expected cost of activating the defense subnetwork. Assuming the expectation is written as an irreducible fraction $P/Q$, output the value of $P \cdot Q^{-1} \pmod{1,000,000,007}$, where $Q^{-1}$ is the unique integer satisfying $Q \cdot Q^{-1} \equiv 1 \pmod{1,000,000,007}$.

Examples

Input 1

3 2
1 2
2 3

Output 1

750000006

Input 2

6 6
1 2
2 3
3 1
1 4
2 5
3 6

Output 2

468750006

Note

Example 1 is a chain, which includes the following cases: $\emptyset, \{1\}, \{2\}, \{3\}$, $|H(S)| = 0$; $\{1, 2\}, \{2, 3\}$, $|H(S)| = 1$; * $\{1, 3\}, \{1, 2, 3\}$, $|H(S)| = 2$.

Therefore, $P/Q = 3/4$, $Q^{-1} = 250,000,002$, $P \cdot Q^{-1} = 750,000,006$.

In Example 2, $\sum_{S \subseteq V} |H(S)| = 174$, therefore $P/Q = 87/32$, $Q^{-1} = 281,250,002$, $P \cdot Q^{-1} = 468,750,006 \pmod{1,000,000,007}$.

Constraints

For 20% of the data, $1 \le n \le 8$. For 40% of the data, $1 \le n \le 20$. For 100% of the data, $1 \le n \le 200$.

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.