Problem in short: You are given a tree with N nodes, where each node i has a value v[i] associated with it. Find nodes i and j, such that i is an ancestor of j and (v[i] - v[j]) is maximized. N <= 10^5.

Indian National Olympiad in Informatics (INOI) is round 2 out of 3 (i.e. intermediate) for selection into Indian IOI team.