https://mirror.codeforces.com/contest/1726/submission/365331041 Can anyone tell me where did i do wrong in this solution ? thanks
Update: My answer in the first test can be drawn in a pic like this

If we remove blue we get 2 connected components, if we remove red we get 1 connected component. So in total we get 3, which is the same with the answer. Was my understanding wrong somewhere?




