문제
Bessie has a connected, undirected graph
Let
Elsie wants to copy Bessie. In particular, she wants to construct an undirected graph
Your job is to count the number of distinct graphs
Each input contains
over all test cases does not exceed
입력
The first line of the input contains
The first line of each test case contains the integers
The next
Consecutive test cases are separated by newlines for readability.
출력
For each test case, the number of distinct
예제1
1
5 4
1 2
2 3
1 4
3 5
3
In the first test case,
5 4
1 2
1 4
3 4
3 5
5 5
1 2
2 3
1 4
3 4
3 5
예제2
7
4 6
1 2
2 3
3 4
1 3
2 4
1 4
5 5
1 2
2 3
3 4
4 5
1 5
5 7
1 2
1 3
1 5
2 4
3 3
3 4
4 5
6 6
1 2
2 3
3 4
4 5
5 6
6 6
6 7
1 2
2 3
1 3
1 4
4 5
5 6
1 6
10 10
1 1
1 2
1 3
1 4
1 5
1 6
1 7
1 8
1 9
1 10
22 28
1 2
2 3
3 4
4 5
5 6
6 7
1 7
1 8
3 9
8 10
10 11
10 12
10 13
10 14
11 15
12 16
13 17
14 18
9 15
9 16
9 17
9 18
15 19
19 20
15 20
16 21
21 22
16 22
45
35
11
1
15
371842544
256838540
These are some larger test cases. Make sure to output the answer modulo
.