you give undirected graph N node M edge e_1 e_2 dot e_ma connect graph cactus edge belog simple cycle a graph desert connect component cactus find number pair L R 1 leq L leq R leq M delete edge e_l e_l1 dot e_r graph desert