← All problemsSign in

Min Max Paths

CodeChefRating 3106Open on judge ↗

Chefland is an undirected, unweighted tree on $N$ nodes. The nodes are labeled from $1$ to $N$. Define: - $\text{pathmin}(u,v) = $ the minimum label of a node on the simple path from $u$ to $v$. - $\text{pathmax}(u,v) = $ the maximum label of a node on the simple path from $u$ to $v$. - $\text{cost}(u,v) = \text{pathmin}(u,v)\cdot\text{pathmax}(u,v)$ If Chef is currently at node $u$, he can mov

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