M friendships exist between N people. They are divided into groups such that all the friends will remain in same group and the people from each group visit each other according to the following conditions:
Write a program to find the number of ways in which the people from each group can visit each other. Two ways are considered different if at least one people visits two different friends.
Input format
Output format
For each test case, first print the number of groups and in next line, print the number of ways in which the people from each group can visit each other, in decreasing order of number of ways.
Constraints
\(1 \le T \le 10^{5}\)
\(1 \le N \le 20 \)
\(1 \le M \le N \times N\)
\(1 \le U, V \le N\)
There are 2 groups: First group consists of {1,2,3} so the number of ways = 2, 1->2->3->1 and 1->3->2->1 where -> represent visit. Second group consists of {4,5} so the number of ways = 1, as friend 4 will visit friend 5 in his/her home and friend 5 will visit friend 4 in his/her home.