Problem of the day
For the given graph
If we remove the connection between ‘2’ and ‘4’. Then ‘4’ will not be reachable from any other server.
The first line contains an integer 'T' which denotes the number of test cases.
The first line of each test case contains two integers ‘N’ and ‘M’, denoting the number of servers and number of connections respectively.
The following ‘M’ lines contain two integers ‘U’ and ‘V’ denoting there is an undirected server-to-server connection between server ‘U’ and server ‘V’.
For each test case, print all the critical connections in any order on separate lines.
You don't need to print anything, it has already been taken care of. Just implement the given function.
1 ≤ T ≤ 10
2 ≤ N ≤ 100
N - 1 ≤ M ≤ 100
1 ≤ U, V ≤ N
Time limit: 1 sec
2
4 4
1 2
1 3
2 3
2 4
3 2
1 2
2 3
2 4
1 2
2 3
In test case 1, the graph is shown below.
If we remove the connection between ‘2’ and ‘4’. Then ‘4’ will not be reachable from any other server.
In test case 2, the graph is shown below.
If we remove the connection between ‘3’ and ‘2’. Then ‘3’ will not be reachable from any other server. Similarly, if we remove the connection between ‘1’ and ‘2’. Then ‘1’ will not be reachable from any other server.
2
2 1
1 2
4 4
1 2
1 3
3 4
2 4
1 2
In test case 1, the graph is shown below.
If we remove the connection between ‘1’ and ‘2’. Then ‘1’ will not be reachable from any other server.
In test case 2, the graph is shown below.
No matter which connection we remove it is not possible to make some servers unable to reach some other server.