#Lutece1479. Magic boy Bi Luo with his excited Graph problem
Magic boy Bi Luo with his excited Graph problem
Migrated from Lutece 1479 Magic boy Bi Luo with his excited Graph problem
All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.
Description
As we know, Bi Luo is a magic boy, he always has some excited questions , now a new question comes.
You are given a simple undircted graph( graph in which both multiple edges and loops are disallowed ) with vertexs and edges, Bi Luo wants you tu caculate the excited value of ,the caculating processing are as follows.
At the begining, the excited value is . then for each non-empty subset of edge , we just think its edge-induced subgraph, we define it as , if all of the vertexs within are in a single connected block and the number of edges in equal to the number of vertexs , it makes excited value ++ , otherwise do nothing. Now, Bi Luo wants to know the excited value of , can you answer it?
Input
First Line is an positive integer , ( ) , represents there are test cases.
For each test case:
The first line contains two positive integers , .( , ) . represents there are vertexs and edges.
The next line, each line contains two integers , ( ) , indicating there is an edge between and .
You may assume that the given graph is always a simple graph and there are no more than two test cases with ,no more than two test cases with .
Output
For tht - test case , first output Case #i: ,then output one integer repretens the excited value,because the excited value may be large, so you only need to output the excited value of mod
Samples
2
3 3
1 2
1 3
2 3
5 5
1 2
1 3
2 3
2 4
3 5
Case #1: 1
Case #2: 4
Resources
“玲珑杯”ACM比赛 Round #2