atcoder#ARC115D. [ARC115D] Odd Degree
[ARC115D] Odd Degree
Score : points
Problem Statement
Given is a simple undirected graph with vertices and edges, where the vertices are numbered and the -th edge connects Vertex and Vertex . For each , find the number of spanning subgraphs (※) with exactly vertices with odd degrees. Since the answers can be enormous, print it modulo .
(※) A subgraph of is said to be a spanning subgraph of when the vertex set of equals the vertex set of and the edge set of is a subset of the edge set of .
Constraints
- The given graph is simple, that is, it contains no self-loops and no multi-edges.
Input
Input is given from Standard Input in the following format:
Output
Print lines. The -th line should contain the answer for .
3 2
1 2
2 3
1
0
3
0
Each spanning subgraph has the following number of vertices with odd degrees:
- the subgraph with no edges has vertices with odd degrees;
- the subgraph with just the edge connecting and has vertices with odd degrees;
- the subgraph with just the edge connecting and has vertices with odd degrees;
- the subgraph with both edges has vertices with odd degrees.
4 2
1 2
3 4
1
0
2
0
1