← All problemsSign in

Can Yamato test

Yamato is planning to test the quality of roads of all N villages in the Fire Kingdom. All the $N$ villages are connected by $N-1$ roads. So he will choose a pair of villages $(u,v)$ and walks from u to v by using the shortest path. Now, There exists two villages $x$ and $y$. $x$ village hates $y$ village very much because both the village has a history of war. So if Yamato were to visit villa

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.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start