Problem Description
As a student in computer science, Ant is weak in Graph Theory learning. One day, he comes across a problem. Given a non-directed graph G which is donated by G = {V, E}. V is the set of vertexes and E is the set of undirected edges. You should select some vertexes as key vertexes and each edge should be connected by at least one key vertex. Ant sometimes can select the key vertexes as described above. But now he wants to select least vertexes as key vertexes. Here comes your question, given a graph and tell Ant how many ways are there to select least key vertexes.
Input
The first line of the input contains an integer T which is the number of test case, and then there are T groups of data following. For each group of data, the first line contains two integers. The first integer n is the number of vertexes and the second integer m is the number of edges. The next following m lines describe the edges. Each line contains two integers u, v which indicates there is an undirected edge connected vertex u and vertex v. (0 < n ≤ 20, 0 < m ≤ 300, u ≠ v, 1 ≤ u, v ≤ n)
Output
For each test case, output an integer which is the number of ways that selecting least key vertexes.
Sample Input
1
4 3
1 2
2 3
3 4
Sample Output
3
Hint
For the sample, there are three ways, which are selecting {1, 3}, {2, 4}, {2, 3}
一只名叫tom的猫
慕标琳琳
相关分类