QOJ.ac

QOJ

実行時間制限: 1 s メモリ制限: 512 MB 満点: 100

#5089. Ring Covering

統計

Formal Problem Statement: Given a simple undirected graph with $n$ vertices and $m$ edges, for each $i \in [0, m]$, calculate the number of ways to choose exactly $i$ edges such that the resulting graph is cycle-coverable. A graph is cycle-coverable if its edge set can be partitioned into several subsets, each forming a cycle.

The answer should be modulo $10^9+7$.

Input

The first line contains two integers $n$ and $m$.

The next $m$ lines each contain two integers $u, v$, representing an edge.

Output

A single line containing $m+1$ integers, where the $k$-th integer represents the answer for $i = k-1$.

Examples

Input 1

3 3
1 2
1 3
2 3

Output 1

1 0 0 1

Note 1

Only the schemes with 0 edges and 3 edges are valid.

Input 2

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

Output 2

1 0 0 6 8 4 4 6 3 0 0

Constraints

For all test cases, $1\le n\le 25, 0\le m\le \dfrac{n(n-1)}{2}$.

Subtask 1 (5 pts): $n, m \le 20$.

Subtask 2 (15 pts): $n \le 20, m \le 40$. Depends on Subtask 1.

Subtask 3 (15 pts): $n = 25, m = 45$, the graph is connected.

Subtask 4 (30 pts): $n \le 20$. Depends on Subtask 2.

Subtask 5 (35 pts): No additional constraints. Depends on Subtask 4.

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.