help in TALCA problem in JULY LUNCHTIME for getting 20 points

In the editorial given to calculate the in_time and out_time for each node by doing dfs from root. ok!! after calculating them how to get answer? plz help me… i’m stuck there… plzzzz

//