Cities are connected by telephone wires and communicating. I want destroy all cities but not alarm another too early, so i disconnect wire before destroying town. I don't want disconnect town what is used as bridge between two cities.
It is Undirected graph if I'm not mistaken. But I do not get it how i can check what cities i can remove and what not. I looked at Tarjan's Algorithm but it i don't get it.
This is test input:
15 19 <- Number of cities and number of connections
1 2 <- Start of connections list
2 3
2 4
2 5
5 6
5 7
7 8
8 9
5 9
1 9
10 11
1 11
11 12
12 13
13 14
1 14
9 14
13 15
9 15
Output can be like this:
10 12 6 3 14 11 4 13 15 8 9 7 5 2 1