Given a unweighted directed graph, yout task is to print the members of strongly connected component in the graph where each component is seperated by ', ' (see the example for more clarity). The Graph can have loops.
The first line of the input consist of 'T' denoting the number of test cases. Each test case consist of two lines, the first line of each test case consist two integers N and m, denoting the number of vertices and edges respectively. Then 'M' lines follows where each line consist of a pair of integers (u and v) representing an edge from u to v. (0 based indexing is used).
For each test case in a new line print the number of Strongly connected component of a graph. where each strongly connected component is seperated by ',' and each member of a strongly connected component is seperated by a space(' '). If there are many such options then print the output that will be provided by the standard implementation of the tarjan's algorithm...:-)
1 2 2 0 2 2
1 2 2 3 3 1 3 4
1 2 3, 4