I didn't understand the editorial of the question.
https://mirror.codeforces.com/contest/1941/problem/G
Can anyone help me to get an idea of the solution, and why they are using these techniques to get the solution? How by using this we are getting the required answer.
In editorial, it asks you to make bipartite graph of stations and subway line. Once you reach a subway line, you can reach all the stations connected to it without incurring extra costs. Now how will you reach from source station to destination station?
Why is the answer of
1 -> 3 = 1
and1 -> 6 = 2
? Think about that.Finally Understood... Thanks:)