Number of nodes
N = 5 ; NEW_LINE Edges = [ [ 1 , 2 ] , [ 1 , 3 ] , [ 3 , 4 ] , [ 3 , 5 ] ] ; NEW_LINE Val = [ 0 , 2 , 3 , 4 , 8 , 16 ] ; NEW_LINE Queries = [ 2 , 3 , 1 ] ; NEW_LINE Q = len ( Queries ) NEW_LINE