QOJ.ac

QOJ

実行時間制限: 3 s メモリ制限: 256 MB 満点: 100 ハック可能 ✓

#4259. Hu Ce's Statistics

統計

In the world of OI, there is a legendary figure known to everyone, a person whose OI skills are unparalleled: Hu Ce, also known in the community as "Master Hu, the One-Look Problem Solver"!

Today, Hu Ce is studying the connectivity of undirected graphs. For an undirected graph, its connectivity value is defined as the factorial of the number of connected components in the graph.

To study the properties of connectivity values, Hu Ce drew a simple undirected graph $G$ with $n$ nodes, labeled $1, \dots, n$. He wants to calculate the sum of the connectivity values of all spanning subgraphs of $G$.

Hu Ce can certainly solve this! But he wants to test you. You only need to output the result modulo $998244353$ ($7 \times 17 \times 2^{23} + 1$, a prime number).

A simple undirected graph is an undirected graph with no multiple edges and no self-loops. A spanning subgraph is a graph formed by removing some (possibly zero) edges from the original graph.

Input

The first line contains two integers $n$ and $m$, representing the number of nodes and edges in $G$. It is guaranteed that $n \geq 1$ and $m \geq 0$.

The next $m$ lines each contain two integers $v$ and $u$, representing an undirected edge between node $v$ and node $u$. It is guaranteed that $1 \leq v, u \leq n$, and there are no multiple edges or self-loops.

Output

A single integer representing the answer.

Examples

Input 1

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

Output 1

16974

Input 2

See sample data download.

Constraints

Test Case ID $n$ Special Constraints
1$\leq 6$None
2$\leq 10$
3
4$\leq 17$
5
6
7$\leq 20$$G$ is a complete graph
8None
9
10

Note

Source: China National Team Training Mutual Assessment 2015 - By Lü Kaifeng

Editorials

IDTypeStatusTitlePosted ByLast UpdatedActions
EditorialOpen Official EditorialQingyu- Download

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.