Task
Alice Elice thought about giving Bob Glob some Christmas gifts. A gift is a string of Christmas tree lights colored red (R) or blue (A) of length N. A good gift satisfies M conditions of the type (i,j) which means that bulb i has a different color than bulb j.
Unfortunately, Alice Elice is out shopping and doesn't have time to calculate how many different good gifts she can buy for Bob Glob.
The first line contains T, representing the number of scenarios. The structure of a scenario is as follows: the first line contains N and M, followed by the next M lines containing two numbers i and j.
Output data
For each scenario, output the number requested by Alice on a separate line, modulo 109+7. If there are no such gifts, print the message Doar carbuni
.
Constraints and clarifications
- 1≤T≤102
- 1≤N≤105
- 0≤M≤105
- The sum of the values of N over all T scenarios is at most 5⋅106.
- The sum of the values of M over all T scenarios is at most 106.
# |
Score |
Constraints |
1 |
25 |
N,M≤20 |
2 |
45 |
N,M≤104 |
3 |
30 |
No additional constraints |
Example 1
stdin
1
5 3
1 2
2 3
4 5
stdout
4
Explanation
The 4 good gifts are:
RARRA
RARAR
ARARA
ARAAR
Example 2
stdin
2
5 2
1 2
1 3
3 3
1 2
2 3
3 1
stdout
8
Doar carbuni
Explanation
- In the first example, the 8 good gifts are:
RAARA
RAAAR
ARRRA
ARRAR
RAARR
RAAAA
ARRRR
ARRAA
- In the second example, it can be demonstrated that there is no solution.