← All problemsSign in

E - Chef and Tax

In Chef-land people have to pay a specific tax to move around the cities. The cities are arranged in a manner of a rooted tree. The king wants to know the maximum tax to be paid by a citizen for going from city $A$ to $B$ and he orders you to find it for him. So, you are given a tree rooted at node $1$ with $N$ vertices and you have to find the maximum tax to be paid to move between any two cit

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