Back In 2 minutes!!
CodeChefOpen on judge ↗
Aditya and his friends are planning to tour India. But each of them is planning to visit different cities. So they came out with some interesting plan. All cities of India(numbered form $1$ to $N$) are inter-connected by $N-1$ bidirectional roads such that each city is reachable by any other. Each of his friends is also numbered from $1 to N$. First of all, each of them will visit his own
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start